Spring 4.3.7 is throwing java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/util/DefaultIndenter

非 Y 不嫁゛ 提交于 2019-12-05 02:07:23

If someone else found this through Google and if You are using SpringBoot, here is what solved the problem for me. Try setting the parent of Your pom file (i.e. Maven project):

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>2.0.2.RELEASE</version>
  <relativePath/> <!-- lookup parent from repository -->
</parent>

This will set the spring-boot-starter version to 2.0.2, and not the 1.x, which was default (at least for me).

Following the comment of Chris Nauroth, I've used the mvn dependency:tree and saw that the 1.x version of SpringBoot used the 2.4.x version of Jackson, whereas spring-boot-starter version 2.x uses Jackson 2.5 or higher.

I had this problem, with Spring 4.3.22.RELEASE and jackson-databind 2.2.3, I only had to upgrade to 2.9.8 and problem solved.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!