zoukankan      html  css  js  c++  java
  • SpringCloud学习笔记-Eureka搭建过程中的出现问题

    问题1:Gson包冲突,启动Server的时候报错,具体信息描述如下:

    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:/C:/Users/farida/.m2/repository/com/google/code/gson/gson/2.1/gson-2.1.jar!/com/google/gson/GsonBuilder.class
    
    It was loaded from the following location:
    
        file:/C:/Users/farida/.m2/repository/com/google/code/gson/gson/2.1/gson-2.1.jar
    
    
    Action:
    
    Correct the classpath of your application so that it contains a single, compatible version of com.google.gson.GsonBuilder
    

      解决方案:排除eureka自身所使用的gson包

        <dependency>
          <groupId>org.springframework.cloud</groupId>
          <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
          <exclusions>
            <exclusion>
              <groupId>com.google.code.gson</groupId>
              <artifactId>gson</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
  • 相关阅读:
    kubernetes----资源控制器5
    kubernetes----二进制安装3
    kubernetes----自动化安装2
    kubernetes----基础1
    PC微信低版本限制登录怎么办?
    mysql排名次
    mysql中GROUP BY中报错
    scrapy框架操作
    python QQ与微信自动发消息
    python中调用js的编码问题
  • 原文地址:https://www.cnblogs.com/guolaoshi/p/12319725.html
Copyright © 2011-2022 走看看