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>
  • 相关阅读:
    JavaScript 数组进行拼接的函数
    Scrum工件
    Scrum角色
    Scrum
    看板kanban
    敏捷估算
    用户故事地图
    用户故事
    用户画像
    AARRR模型
  • 原文地址:https://www.cnblogs.com/cat-fish6/p/11383025.html
Copyright © 2011-2022 走看看