Recently, spring4.x was used to integrate Jackson ------ & gt; java. lang. ClassNotFoundException :,

Source: Internet
Author: User

Recently, spring4.x was used to integrate Jackson ------> java. lang. ClassNotFoundException :,

Recently, Jackson was integrated with spring4.x, and the results were inexplicably reported. The online retrieval results were all solved by configuring the dependency conditions in the maven or gradle environment; however, the jar package in the eclipseIDE environment should be automatically dependent on the shadow. The answer to the problem has not been found.

Later, I had a solution. I suspected that the version problem was caused by the version problem. Spring4.x must be at least Jackson2.6 or later for matching.

The error is as follows:

 

<span>java.lang.ClassNotFoundException: com.fasterxml.jackson.core.util.DefaultIndenter      at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308)      at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1142)</span>
<span>class org.springframework.web.context.ContextLoaderListener  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/util/DefaultIndenter      </span>
<span>DefaultIndenter </span> 

Replace Jackson's package with more than 2.6. Three core packages are available on the Internet.

Related Article

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.