SpringCloud 학습 노트 - Eureka 구축 과정 에서 문제 가 발생 했 습 니 다.

문제 1: Gson 패키지 가 충돌 하여 서버 를 시작 할 때 오류 가 발생 했 습 니 다. 구체 적 인 정 보 는 다음 과 같 습 니 다.
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 패키지 제외
    
      org.springframework.cloud
      spring-cloud-starter-netflix-eureka-server
      
        
          com.google.code.gson
          gson
        
      
    

좋은 웹페이지 즐겨찾기