[Error] ES error can not find the Gson class

Error message

java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration

Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]

Caused by: java.lang.NoClassDefFoundError: com / google / gson / Gson

Caused by: java.lang.ClassNotFoundException: com.google.gson.Gson

solve

Error when starting dubbo provider:

Found: es can't find gson's class

Exclude jest's gson and re-introduce the lower version of gson

5.x jest introduces the 2.8x version of gson

After the exclusion, the gson version 2.6 is introduced, and the project runs smoothly;

It is not clear what the specific reason is, and the big brother who wants to know can point it out;

<dependency>
    <groupId>io.searchbox</groupId>
    <artifactId>jest</artifactId>
    <version>5.3.4</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.6</version>
</dependency>

Guess you like

Origin www.cnblogs.com/mussessein/p/12702791.html