error:com/fasterxml/jackson/databind/exc/InvalidDe

Because it will give the tip to return json data, jackson package introduced in the pom file to start the project when he has been given

java.lang.NoClassDefFoundError: com / fasterxml / jackson / databind / exc / InvalidDefinitionException.
Jackson first thought is the lack of a jar, looked at, basically. After the Internet to find resources generally say what packet collisions, go pom.xml file viewing, and there ali warehouse fastjson and another json package seem to overlap, and finally another deleted, or reported the above problem, the Internet to find resources effort pays off is compatibility issues, my spring is 5.0, so the package corresponds jackson you want to upgrade to 2.7 or more

Finally resolved.

java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

This information is relevant for the spring and jackson versions are not compatible

I am using Spring5.0.8 version, the local jsckson above version 2.7.5 or higher to rise

Spring is compatible jackson 4.3.2 version 2.7.5 and later, its dependencies as follows:

<!--jackson依赖-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.9.5</version>
</dependency>

Guess you like

Origin blog.51cto.com/11585002/2448635