Spring 4.3.7抛出java.lang.NoClassDefFoundError:com / fasterxml / jackson / core / util / D...

栏目: Java · 发布时间: 7年前

内容简介:翻译自:https://stackoverflow.com/questions/45060443/spring-4-3-7-is-throwing-java-lang-noclassdeffounderror-com-fasterxml-jackson-c
当我从 spring

4.3.4迁移到4.3.7时,我在添加Jackson-core依赖后面临NoclassDefined错误

Caused By: 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

我试着添加杰克逊核心

<dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>2.8.5</version>
            </dependency>

依赖也没有运气

任何能够阐明这一点的人都会受到赞赏.

谢谢

维诺德

如果其他人通过Google发现了这一点,并且您使用的是SpringBoot,那么这就解决了我的问题.尝试设置您的pom文件的父级(即Maven项目):

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

这会将spring-boot-starter版本设置为2.0.2,而不是1.x,这是默认值(至少对我而言).

在 the comment of Chris Nauroth 之后,我使用了mvn依赖:tree并看到1.x版本的SpringBoot使用了2.4.x版本的Jackson,而spring-boot-starter版本2.x使用了Jackson 2.5或更高版本.

翻译自:https://stackoverflow.com/questions/45060443/spring-4-3-7-is-throwing-java-lang-noclassdeffounderror-com-fasterxml-jackson-c


以上所述就是小编给大家介绍的《Spring 4.3.7抛出java.lang.NoClassDefFoundError:com / fasterxml / jackson / core / util / D...》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

Effective C++

Effective C++

[美]Scott Meyers / 侯捷 / 电子工业出版社 / 2006-7 / 58.00元

《Effective C++:改善程序与设计的55个具体做法》(中文版)(第3版)一共组织55个准则,每一条准则描述一个编写出更好的C++的方式。每一个条款的背后都有具体范例支撑。第三版有一半以上的篇幅是崭新内容,包括讨论资源管理和模板(templates)运用的两个新章。为反映出现代设计考虑,对第二版论题做了广泛的修订,包括异常(exceptions)、设计模式(design patterns)......一起来看看 《Effective C++》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换