Springmvc Org.springframework.http.converter.json.MappingJackson2HttpMessageConverter relies on the Jackson bag

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.