zoukankan      html  css  js  c++  java
  • SpringBoot中pom引入gson异常

     在pom中引入gson依赖,启动spring boot项目中报错

    Description:

    An attempt was made to call the method com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; but it does not exist. Its class, com.google.gson.GsonBuilder, is available from the following locations:

        jar:file:/D:/work/code/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar!/com/google/gson/GsonBuilder.class

    It was loaded from the following location:

        file:/D:/work/code/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar


    Action:

    Correct the classpath of your application so that it contains a single, compatible version of com.google.gson.GsonBuilder
    开始以为jar包冲突,查询各个pom发现并没有重复依赖,最后将2.2.4版本换为2.6版本后启动正常

    <dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.6</version>
    <!--<scope>compile</scope>-->
    </dependency>
  • 相关阅读:
    POJ 3417 Network
    指针动态开空间的板子
    fread()的板子
    luguo P1970 花匠
    Uva
    Uva
    Uva
    Uva
    Uva
    什么才算是真正的编程能力?
  • 原文地址:https://www.cnblogs.com/cat-fish6/p/11383025.html
Copyright © 2011-2022 走看看