OpenAPI java SDK,GSON依赖冲突,无法解决。
131 浏览2025年03月05日作者:dayouzuowei
OpenAPI java SDK gson有冲突,但是尝试maven移除,发现不起作用。依旧启动报错。
  <dependency>
    <groupId>com.douyin.openapi</groupId>
    <artifactId>sdk</artifactId>
    <version>1.0.1</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </exclusion>
    </exclusions>
</dependency>

启动报错信息:
Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    java.lang.invoke.MethodHandleNatives.resolve(Native Method)

The following method did not exist:

    com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;

The method's class, com.google.gson.GsonBuilder, is available from the following locations:

    jar:file:/root/work/caree-quiz/main/career-quiz.jar!/BOOT-INF/lib/sdk-1.0.1.jar!/com/google/gson/GsonBuilder.class
    jar:file:/root/work/caree-quiz/main/career-quiz.jar!/BOOT-INF/lib/gson-2.8.9.jar!/com/google/gson/GsonBuilder.class

The class hierarchy was loaded from the following locations:

    com.google.gson.GsonBuilder: jar:file:/root/work/caree-quiz/main/career-quiz.jar!/BOOT-INF/lib/sdk-1.0.1.jar!/


Action:

Correct the classpath of your application so that it contains a single, compatible version of com.google.gson.GsonBuilder
最后一次编辑于 2025 年 03 月 05 日
4 条评论

相关问答

专题推荐

热门文章

热门问答