Skip to content

Gson is embedded within the jar causing version compatibility with Spring Boot #145

@ashisjena

Description

@ashisjena

Newer spring is expecting the GsonBuilder to have method "setStrictness" in their GsonAutoConfiguration class. But as Gson is not used as an dependency rather is embbeded in the jar.

Error logs:

java.lang.NoSuchMethodError: 'com.google.gson.GsonBuilder com.google.gson.GsonBuilder.setStrictness(com.google.gson.Strictness)'

The called method's class, com.google.gson.GsonBuilder, is available from the following locations:

jar:file:/Users//.m2/repository/com/datasonnet/datasonnet-mapper/3.0.0/datasonnet-mapper-3.0.0.jar!/com/google/gson/GsonBuilder.class
jar:file:/Users/
/.m2/repository/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar!/com/google/gson/GsonBuilder.class

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration$StandardGsonBuilderCustomizer and com.google.gson.GsonBuilder

Expected:
The Gson should be added as an maven dependency instead of copying the class files to the jar of the datasonnet-mapper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions