Comments (7)
@keaixx365 不升级spring-boot的方法如下:
<dependency> <groupId>com.github.wechatpay-apiv3</groupId> <artifactId>wechatpay-java</artifactId> <version>0.2.1</version> <exclusions> <exclusion> <artifactId>okhttp</artifactId> <groupId>com.squareup.okhttp3</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>5.0.0-alpha.10</version> </dependency>
from wechatpay-java.
请参考下 #60 。
我猜测是你在项目中指定,或者其他组件依赖了 OkHttp 3.x。你可以手工指定 OkHttp 使用 4.x 版本。
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.10.0"))
另外,如果方便的话,能告诉我是什么引入了 OkHttp 3.x吗?或者贴一下完整依赖树。
from wechatpay-java.
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.6.3
<java.version>17</java.version>
true
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-starter-data-rest
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-java</artifactId>
<version>0.2.1</version>
</dependency>
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.34.68.ALL</version>
</dependency>
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.19.android</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.3</version>
</plugin>
</plugins>
</build>
from wechatpay-java.
我估计是因为你使用了 spring-boot 2.6,它依赖的是 OkHttp 3.14,所以导致 wechatpay-java-core 也用了 OkHttp 3.x。
现在有两条路:
- 手工指定 OkHttp 使用 4.x。但是需要观察 spring-boot 对 OkHttp 4.x 的兼容性。虽然 OkHttp4 号称”除了一些小的例外(如下),OkHttp 4.x 与 OkHttp 3.x 二进制和 Java 源代码兼容“。
- 将 spring-boot 框架升级到 2.7。在 2.7 后使用的是 OkHttp 4.x。这样可以避免 spring-boot 对 OkHttp4 的兼容问题,你需要付出框架的迁移成本。
from wechatpay-java.
com.github.wechatpay-apiv3 wechatpay-java 0.2.1 okhttp com.squareup.okhttp3 com.squareup.okhttp3 okhttp 5.0.0-alpha.10
谢谢,这个问题已解决,不过验证response又出错😅
from wechatpay-java.
和楼主同样的问题
Spring-Boot 2.1.6
手工指定OkHttp 4.x 会报错java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto([B[BIII)[B
from wechatpay-java.
好歹是服务十几亿人的平台,多搞搞兼容性嘛
from wechatpay-java.
Related Issues (20)
- 一个商户号只能初始化一个RSAAutoCertificateConfig 如果商户号参数发生变化 怎么重载RSAAutoCertificateConfig呢
- 普通商户分账 https://api.mch.weixin.qq.com/secapi/pay/profitsharing HOT 1
- JsapiServiceExtension的prepayWithRequestPayment预下单接口 HOT 2
- 总是提示验签失败 HOT 2
- 缺少NATIVE 下单通知响应相关API,可以参考统一下单支付成功的通知。
- 沙箱环境问题 HOT 1
- privateKeyPath 能不能动态加载多个不同的文件 比如多个商户号多个证书文件 HOT 2
- 你们这Java Bean就不能合并提取一下么,一个名字一大堆,关键接口都是同一个 HOT 1
- 文档回调通知代码错误 HOT 1
- JsapiServiceExtension能添加static修饰成全局变量吗?是否线程安全? HOT 2
- 付款码支付推荐用3.0的SDK,结果SDK里面压根儿就没包含付款码的请求
- 下单之后,没有立刻支付,此时再去查订单状态,到底是啥closed?还是notpay, HOT 3
- 发起商家转账,设置回调,InitiateBatchTransferRequest根本没法设置回调 HOT 8
- APP 支付问题
- 您好,我在接预扣费通知API,请问可以使用咱们提供的微信支付 APIv3 Java SDK吗
- 当前不支持合单支付接口的调用,希望更新版本并支持合单支付
- 为什么私钥路径一定要是绝对路径,多个项目成员如何管理这个路径 HOT 1
- 【电子发票】电子发票Java实现
- 生成h5领券链接 错误码 268697610 是什么情况,官方文档没有说明 HOT 1
- Illegal base64 character 2d 报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wechatpay-java.