SpringMvc jackson NoSuchMethodError solution

Question: I recently learned mybatis and springmvc and reported an error when the spring controller returned the queried entity class json

java.lang.NoSuchMethodError: org.codehaus.jackson.map.SerializationConfig.isEnabled(Lorg/codehaus/jackson/map/SerializationConfig$Feature;)Z

It is jsckson that throws an exception when doing json conversion.


Solution: The test found that it was caused by the spring version and jackson version problem

3.2.5.RELEASE version spring jackson-mapper-asl version must be 1.9.11 or above

3.1.1.RELEASE version spring can use jackson 1.9.1 or above.

Since my version is:

<version> 3.2.5.RELEASE </version>
<version> 1.9.1 </version>

So incompatible, resulting in an exception.

Guess you like