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

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

内容简介:翻译自: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...》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

Android 源码设计模式解析与实战

Android 源码设计模式解析与实战

何红辉、关爱民 / 人民邮电出版社 / 2015-11 / 79.00元

本书专门介绍Android源代码的设计模式,共26章,主要讲解面向对象的六大原则、主流的设计模式以及MVC和MVP模式。主要内容为:优化代码的首步、开闭原则、里氏替换原则、依赖倒置原则、接口隔离原则、迪米特原则、单例模式、Builder模式、原型模式、工厂方法模式、抽象工厂模式、策略模式、状态模式、责任链模式、解释器模式、命令模式、观察者模式、备忘录模式、迭代器模式、模板方法模式、访问者模式、中介......一起来看看 《Android 源码设计模式解析与实战》 这本书的介绍吧!

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具