I have downloaded eclipse and installed the spring suit into it. I have written a JPA based Rest application by following one of the spring.io guides. When I try to run it a
I faced the same problem and had to waste a lot of time trying to fix this.
The problem arises due to the version mismatch of the Gson library from existing dependencies already included in your project with that of Spring Boot's default one.
The easiest fix of this problem (that worked for me) is to replace each occurrence of the
@EnableAutoConfiguration
tag with
@EnableAutoConfiguration(exclude = {org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration.class})
which basically tells the Spring boot application to skip auto configuration for Gson.
This solution also applies to any other class that might create the same problem. You just need to add the name of each such conflicting class to the exclude attribute of EnableAutoConfiguration.