GithubHelp home page GithubHelp logo

Comments (6)

xy-peng avatar xy-peng commented on May 30, 2024

wechatpay-java 依赖的是 OkHttp 4.x,你项目中引入的是 3.x。

建议谨慎地升级,参考adding-constraints-transitive-deps 指定 OkHttp 4.x 版本。按照 OkHttp 官方的迁移指南,OkHttp 4.x 和 OkHttp 3.x 是二进制和 Java 源代码兼容。

希望收到你兼容性的报告。

from wechatpay-java.

xl277541808 avatar xl277541808 commented on May 30, 2024

可是我是直接引的jar包呀,
image

com.github.wechatpay-apiv3
wechatpay-java
0.2.0

意思是这个打好的jar里面引用错了,需要我自己去引OkHttp 4.x 版本?

from wechatpay-java.

xy-peng avatar xy-peng commented on May 30, 2024

猜测是你在项目主动依赖了 OkHttp 3.x 或者依赖的其他组件依赖了。你用 IDE 或者 gradle 查看下项目的依赖就知道了。

也可以参考下其他项目 类似问题的指引

from wechatpay-java.

zijianrs avatar zijianrs commented on May 30, 2024

@xl277541808 我跟你遇到了一样的问题 按照如下所示修改 pom 文件得以解决

        <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>4.10.0</version>
        </dependency>

@xy-peng 我查看了下依赖树 发现 wechatpay-java-core 引入的 okhttp 版本是 3.14.9 如下图所示
image

from wechatpay-java.

xl277541808 avatar xl277541808 commented on May 30, 2024

@xl277541808 我跟你遇到了一样的问题 按照如下所示修改 pom 文件得以解决

        <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>4.10.0</version>
        </dependency>

@xy-peng 我查看了下依赖树 发现 wechatpay-java-core 引入的 okhttp 版本是 3.14.9 如下图所示 image


@zijianrs
大佬,我按照你说的试过。原本是这样, wechatpay-java-core 自身内部依赖的是okhttp 3.14.9
image
然后,改了之后:
image
运行报错,提示同样的问题
image

from wechatpay-java.

xl277541808 avatar xl277541808 commented on May 30, 2024

@zijianrs
后来,为了赶时间,没有研究了。用了另一种方式:wechatpay-apache-httpclient
image
这个感觉挺简单的。拿进来就能用了,
image
然后是调用接口,二维码地址一下就出来了
image
我猜,是不是环境不一样。我是在spring-boot api 里面使用的

from wechatpay-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.