1, problem details: Spring after using 4.3.5.Release version
Error message after configuring the JSON parser in the SPRINGMVC configuration file
[Org.springframework.web.context.ContextLoader] Context initialization failedorg.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' Org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter#0 ' ... caused by:org.springframework.beans.factory.CannotLoadBeanClassException:Cannot Find class [ Org.springframework.http.converter.json.MappingJacksonHttpMessageConverter] for beans with name ' Org.springframework.http.converter.json.mappingjacksonhttpmessageconverter#2aa148c0 ' ... Caused by:java.lang.ClassNotFoundException: Org.springframework.http.converter.json.MappingJacksonHttpMessageConverter ...
2. Reason:
Spring4.0 after Jackson dependency package is not the same cause
3. Solution
The jar corresponding to the org.springframework.http.converter.json.MappingJackson2HttpMessageConverter is used after the Spring 4.x.x version
Configuring the Jackson dependency package in Maven
1 <Dependency>2 <groupId>Com.fasterxml.jackson.core</groupId>3 <Artifactid>Jackson-core</Artifactid>4 <version>2.8.5</version>5 </Dependency>6 <Dependency>7 <groupId>Com.fasterxml.jackson.core</groupId>8 <Artifactid>Jackson-databind</Artifactid>9 <version>2.8.5</version>Ten </Dependency> One <Dependency> A <groupId>Com.fasterxml.jackson.core</groupId> - <Artifactid>Jackson-annotations</Artifactid> - <version>2.8.5</version> the </Dependency>
Use Org.springframework.http.converter.json.MappingJacksonHttpMessageConverter after Spring 3.x.x version
Depend on the Jackson bag
1 <Dependency>2 <groupId>Org.codehaus.jackson</groupId>3 <Artifactid>Jackson-mapper-asl</Artifactid>4 <version>1.9.13</version>5 </Dependency>
Springmvc Org.springframework.http.converter.json.MappingJackson2HttpMessageConverter relies on the Jackson bag