spring-projects / spring-hateoas

Spring HATEOAS - Library to support implementing representations for hyper-text driven REST web services.
https://spring.io/projects/spring-hateoas
Apache License 2.0
1.04k stars 477 forks source link

Error throws java.lang.NoClassDefFoundError: org/springframework/hateoas/Identifiable #1807

Open Thangaduraia opened 2 years ago

Thangaduraia commented 2 years ago

I updated the spring boot version as 2.7.1 and Hateos as 1.5.1. Jackson-databind as 2.13.3

       `<dependency>
            <groupId>org.springframework.hateoas</groupId>
            <artifactId>spring-hateoas</artifactId>
            <version>1.5.1</version>
       </dependency>

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <version>2.7.1</version>
       </dependency>

       <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.13.3</version>
        </dependency>`

After upgrading the version, I am getting java.lang.NoClassDefFoundError: org/springframework/hateoas/Identifiable exception when trying to call objectMapper.readValue method.

objectMapper.readValue(json, aClass);

aClass contains the following properties

private Links links; private Products products;

I think the problem with links properties. When I am trying to map the response with model class getting this error.

I am calling the some of the rest service with MediaType.valueOf("application/hal+json") and map with respective model class.

It worked with previous versions. Can you please guide?

Thangaduraia commented 2 years ago

Hi Team, Did any one faced this issue? I am struggling for long time