开发工具分享
  • 首页
  • 计算科学
  • 文化旅游
  • 项目和网站
    • OSSEZ 计算技术
    • USRealEstate 社区
    • 地区文化
    • CWIKI.US
    • BUG.OSSEZ.COM
    • RSS.OSSEZ.COM
CWIKIUS.CN
一个有独立思考和温度的清新站
Computer Science

Okhttp 的 retrofit2 运行警告信息异常

最近在使用一个 okhttp 的项目运行的时候得到下面的警告信息。 WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by retrofit2.Platform (file:/C:/Users/yhu/.m2/repository/com/squareup/retrofit2/retrofit/2.9.0/retrofit-2.9.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int) WARNING: Please consider reporting this to the maintainers of retrofit2.Platform WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release     针对这个问题,已经有官方的说明, 说明的地址为:Illegal reflective access · Issue #3341 · square/retrofit · GitHub 解决办法 我们可以有下面的一些解决方案: 可以持续使用 Retrofit 2.8.x 或者更新的版本,或者你可以使用 JDK 17 的版本。 如果你不想升级 JDK 版本的话,你可以继续使用 Retrofit 2.7 版本来避免这个问题。 https://www.ossez.com/t/okhttp-retrofit2/14340

2023年04月01日 0Comments 494Browse 0Like Read more
Computer Science

应该升级 JDK 到 17 了吗

因为 Spring 的发布线路图决定了将要使用 JDK 17 的版本。     查看了下 Oracle 的 JDK 维护版本,JDK 11 显然是一个过度版本,而且马上就要终止支持了。 目前应该是准备升级到 JDK 17 了。 如果你还在使用 JDK 11 的话,是时候考虑要升级了。   https://www.ossez.com/t/jdk-17/14339

2023年04月01日 0Comments 592Browse 0Like Read more
Computer Science

OpenAI-J 如何进行测试

当你检出 OpenAI-J 项目以后,你可以对 OpenAI-J 进行测试。 在测试之前你首先需要获得 OpenAI 的 API Key。 OpenAI 的 Key通常是以 sk 开头的字符串。     最简单粗暴的办法就是把获得的 key 替换掉上面的字符串,然后进行测试就可以了。 运行 Unit 测试 在我们的代码中的 Unit 测试中,我们使用了代码: String token = System.getenv("OPENAI_TOKEN"); 上面的代码就是从你的本地环境变量中获得 Key,然后注入到你的代码中。这样的好处是可以避免在提交代码的时候把 key 也一并提交了。 设置环境变量 针对 Windows 环境。     把你的环境变量设置上去,需要注意的是,名称需要和代码中使用的名称一致。 然后直接运行测试程序。     在控制台上,你可以看到 API 调用的输出。   https://www.ossez.com/t/openai-j/14338

2023年04月01日 0Comments 640Browse 0Like Read more
Computer Science

微信 API 的发送客服消息返回对象不正确

因为返回消息的对象不正确,导致有下面的异常: 15:22:28.669 [task-5] DEBUG c.o.w.o.a.i.o.i.WeChatErrorInterceptor - WeChat Response String - {"errcode":0,"errmsg":"ok"} 15:22:28.672 [task-5] ERROR o.s.a.i.SimpleAsyncUncaughtExceptionHandler - Unexpected exception occurred invoking async method: public void com.northtecom.visatrack.api.service.impl.ChatGPTService.processChatGPTContent(java.lang.String) java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "errcode" (class com.ossez.wechat.common.model.WeChatAccessToken), not marked as ignorable (2 known properties: "expires_in", "access_token"]) at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 13] (through reference chain: com.ossez.wechat.common.model.WeChatAccessToken["errcode"]) at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46) at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:93) at io.reactivex.Single.blockingGet(Single.java:2870) at com.ossez.wechat.oa.api.impl.okhttp.WeChatMsgService.sendMessage(WeChatMsgService.java:65) at com.northtecom.visatrack.api.service.impl.WeChatService.sendMessage(WeChatService.java:209) at com.northtecom.visatrack.api.service.impl.ChatGPTService.processChatGPTContent(ChatGPTService.java:94) at com.northtecom.visatrack.api.service.impl.ChatGPTService$$FastClassBySpringCGLIB$$86883789.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "errcode" (class com.ossez.wechat.common.model.WeChatAccessToken), not marked as ignorable (2 known properties: "expires_in", "access_token"]) at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 13] (through reference chain: com.ossez.wechat.common.model.WeChatAccessToken["errcode"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1127) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2036) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1700) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1678) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:320) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2051) at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1459) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:33) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23) at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243) at retrofit2.OkHttpCall.execute(OkHttpCall.java:204) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46) at io.reactivex.Observable.subscribe(Observable.java:12284) at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35) at io.reactivex.Observable.subscribe(Observable.java:12284) at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(Observ 问题和解决 重新定义 WeChatStatus 对象来处理微信消息发送时候的状态返回。     上面是微信官方网站上提供的返回信息,我们的对象需要和上面的返回信息对应。 修改后的日志能解决这个状态的问题。   https://www.ossez.com/t/api/14337  

2023年04月01日 0Comments 653Browse 0Like Read more
Computer Science

PHP Windows 下 XAMPP 的 xdebug 配置

在 IntelliJ 下调试 PHP 的断点有时候还是比较困惑的。 同时根据你使用的 xdebug 配置也有关系。 xdebug 2.x 下面的配置是 xdebug Version 2 的配置,如果你使用 xdebug 3.x 版本的话,配置是不同的。 [XDebug] zend_extension = "php_xdebug.dll" xdebug.remote_autostart = 1 xdebug.profiler_append = 0 xdebug.profiler_enable = 0 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir = "/xampp/tmp" xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" xdebug.remote_host = "127.0.0.1" xdebug.remote_log = "/xampp/tmp/xdebug.txt" xdebug.remote_port = 9000 xdebug.trace_output_dir = "/xampp/tmp" xdebug.remote_cookie_expire_time = 36000 xdebug 3.x 下面的配置是 xdebug 3.x 版本的配置,这个版本的配置已经有了不少的修改。 如果直接使用 xdebug 2.x 版本的配置的话,可能会遇到 IntelliJ 断点不停的问题。 [XDebug] zend_extension = "xdebug" xdebug.mode=debug xdebug.client_host = 127.0.0.1 xdebug.client_port = "9003" xdebug.start_with_request=yes     改变 从 xdebug 3.x 开始,默认的调试端口使用了 9003 的端口,这个与 xdebug 2.x 使用的 9000 端口是不一样的。 这个需要注意。 另外:xdebug.start_with_request=yes 参数必须要添加,否则 IntelliJ 的断点不停。 官方的这篇文章:Configure Xdebug | IntelliJ IDEA Documentation 非常值得参考,最好仔细阅读下。 https://www.ossez.com/t/php-windows-xampp-xdebug/14334

2023年04月01日 0Comments 501Browse 0Like Read more
Computer Science

Window 的 PHP XAMPP 安装 mongodb 的扩展

需要安装的扩展为: extension=php_mongodb.dll 根据官方的指引:PHP: Installing the MongoDB PHP Driver on Windows - Manual 1 需要到 GitHub 上下载扩展,然后进行安装。     这里的版本选择有些讲究。 首先1.51 是 mongoDB 的驱动版本号,选择最新的就可以了。 8.1 是你的 PHP 版本号,你需要根据你安装的 PHP 版本来选择不同的文件。 TZ 是线程安全,NTZ 非线程安全。一般我们会选择线程安全。 X86 和 X 64 为操作系统的位,如果你是 64 位的操作系统,你就可以选择 64 位的。 如果选择错了,XAMPP 在重启的时候会报错,说你的驱动装不上去。 修改 php.ini 修改 php.ini 配置信息,让 Apache 能够载入 mongoDB 的扩展。     虽然我们下载的文件名称为 php_mongodb.dll,但是在加载扩展的时候,只需要写 mongodb 就可以了,不需要写完整的扩展名字 常见的配置错误信息 我们可能会遇到下面的一些常见问题。 PHP Warning: PHP Startup: Unable to load dynamic library 'php_mongodb.dll' (tried: \\xampp\\php\\ext\\php_mongodb.dll (The specified module could not be found), \\xampp\\php\\ext\\php_php_mongodb.dll.dll (The specified module could not be found)) in Unknown on line 0 [Thu Feb 23 08:27:36.477428 2023] [mpm_winnt:notice] [pid 11368:tid 460] AH00354: Child: Starting 150 worker threads. 上面的问题就是你扩展名字使用得不对,然后 Apache 提示 PHP 找不到对应的扩展。 把扩展名改一下就可以了。 PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb' (tried: \\xampp\\php\\ext\\mongodb (The specified module could not be found), \\xampp\\php\\ext\\php_mongodb.dll (The specified module could not be found)) in Unknown on line 0 [Thu Feb 23 08:31:34.326869 2023] [mpm_winnt:notice] [pid 23212:tid 464] AH00354: Child: Starting 150 worker threads. 上面的问题是你下载扩展的 PHP 版本不兼容。 原因是,我们的 PHP 是 8.1 的,但是扩展我们却使用了 7.1,这个会提示上面的错误信息。 PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb' (tried: \\xampp\\php\\ext\\mongodb (The specified module could not be found), \\xampp\\php\\ext\\php_mongodb.dll (%1 is not a valid Win32 application)) in Unknown on line 0 [Thu Feb 23 08:35:09.928157 2023] [mpm_winnt:notice] [pid 14060:tid 460] AH00354: Child: Starting 150 worker threads. 上面的问题是,你使用的操作系统是 64 位的操作系统,但是你却安装了一个 86(32位)操作系统的扩展。     xampp 通常能够在日志上提供完整的信息,因此只需要根据日志进行修改就可以了。 校验 随后打开 php 的配置信息页面。 如果你能和下面的图一样看到 PHP 有关 mongodb 的配置信息的话,则说明 mongodb 在你的环境下的配置已经成功了。   https://www.ossez.com/t/window-php-xampp-mongodb/14333

2023年04月01日 0Comments 877Browse 0Like Read more
Computer Science

PHP 的 json_encode 异常

最近在做一个老的 PHP 项目的时候,json_encode 没有返回任何数据。 这是因为 json_encode 在处理字符的时候有不是 UTF-8 的字符异常了。 解决办法 其实这个方法提供了 JSON_UNESCAPED_UNICODE 参数 用PHP的json_encode来处理中文的时候, 中文都会被编码, 变成不可读的, 类似"\u***"的格式, 还会在一定程度上增加传输的数据量。 <?php echo json_encode("中文"); //"\u4e2d\u6587" 在PHP5.4, 这个问题终于得以解决,Json新增了一个选项::JSON_UNESCAPED_UNICODE, 故名思议, 就是说, Json 不要编码 Unicode。 <?php echo json_encode("中文", JSON_UNESCAPED_UNICODE); //"中文" https://www.ossez.com/t/php-json-encode/14331

2023年04月01日 0Comments 592Browse 0Like Read more
U.S.

关于 USRealEstate 公众号的重要更新

公众号主体配置和调整的需求,USRealEstate 公众号不再进行更新和维护。 所有的内容不再更新和维护,所有的已有内容已经全部迁移到公众号:SharkFly 关注公众号 SharkFly     更多的服务 SharkFly 公众号通过微信认证,我们将会在这个公众号中集成更多的 API 接口和数据。 房地产数据 房地产数据也会通过 SharkFly 公众号来进行提供。 我们建议您关注 SharkFly 来和我们取得联系。 https://www.visafn.com/t/usrealestate/247

2023年04月01日 0Comments 583Browse 0Like Read more
Computer Science

ChatGPT 嵌入微信公众号中的访问

如果需要解决 ChatGPT 长期超时的问题。 我们需要解决微信公众号的异步消息问题。 在公众号 SharkFly 中,我们嵌入了 ChatGPT 的嵌入式访问。 虽然并没有达到完全的智能化,但是已经可以实现部分访问功能了。   如何使用 关注 SharkFly 这个公众号,然后发送消息给这个公众号。 公众号将会调用接口把返回的结果作为消息发布给你。 https://www.ossez.com/t/chatgpt/14329

2023年04月01日 0Comments 541Browse 0Like Read more
Computer Science

IntelliJ IDEA 新版 UI 中的项目导航改进

IntelliJ IDEA 在新版中对项目导航的 UI 进行了改进。     你可以在 IntelliJ IDEA 中通过单击上面项目的名称来选择自己的项目。 在老的 IntelliJ IDEA 中,你需要多次单击鼠标才能完成上面的操作。 这也算 IntelliJ IDEA 一个不错的改进。   https://www.ossez.com/t/intellij-idea-ui/14326

2023年04月01日 0Comments 500Browse 0Like Read more
1…9394959697…309
Archives
  • July 2026
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
Categories
  • Computer Science (2,385)
    • Confluence (663)
    • Gradle (12)
  • U.S. (557)
  • 文化旅游 (146)

COPYRIGHT © 2020 CWIKIUS. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS

湘ICP备2020018253号-1