代码拉取完成,页面将自动刷新
默认报错:
"Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: okhttp3.RequestBody.create(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody;",
换低版本okhttp3也是报这错。
换高版本报错:Exception in thread "OkHttp Dispatcher" java.lang.NoSuchFieldError: instance
有啥解决办法吗
我的也是
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
@刘仕杰 @曾宇仔 不好意思,最近太忙了,没注意看消息。
SpringBoot-2.6.x内置的是okhttp-3.x(源码是Java),我这里用的是okhttp-4.x(源码是Kotiln),且用了4.x的一些新特性,所以导致版本冲突了。
如果不能升级SpringBoot,将以下这个版本管理加入到你的pom.xml
里面即可,版本可以和chatgpt-spring-boot-starter
的okhttp版本保持一致:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-sse</artifactId>
<version>4.10.0</version>
</dependency>
</dependencies>
</dependencyManagement>
登录 后才可以发表评论