最近用spring4.x整合Jackson,结果莫名其妙的一直报错,网上收索的结果都是在maven或者gradle的环境下配置依赖条件解决的;但是eclipseIDE环境下的jar包应该是会自动依赖影射的。结果一直也没找到可以解决的答案。

后来实在是木有办法了,怀疑到版本的问题了,结果就是版本问题导致的。spring4.x 至少要用Jackson2.6以上才能匹配。

错误如下:

<span style="font-size:18px;">java.lang.ClassNotFoundException: com.fasterxml.jackson.core.util.DefaultIndenter
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:)</span>
<span style="font-size:18px;">Exception sending context initialized event to listener instance of 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 style="font-size:18px;">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
</span>

  把Jackson的包换成2.6以上就能解决了。三个核心包,网上都有的。

SpringMVC 整合Jackson报错的更多相关文章

  1. 关于springmvc 整合jackson报错问题

    spring mvc 在整合jackson中报错如下 Context initialization failed org.springframework.beans.factory.BeanCreat ...

  2. 关于SpringMVC整合freemarker报错问题

    错误信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FreeMa ...

  3. spring+hibernate整合:报错org.hibernate.HibernateException: No Session found for current thread

    spring+hibernate整合:报错信息如下 org.hibernate.HibernateException: No Session found for current thread at o ...

  4. weblogic 整合cxf 报错:cannot create a secure XmlInputFactory

    weblogic 整合cxf 报错:cannot create a secure XmlInputFactory ================================ ©Copyright ...

  5. spring整合quartz报错

    今天spring整合quartz报错,最后一步步排查,发现是和redis依赖冲突,最后redis升级了一下,问题解决. 总结:发现问题,逐一排查,如果是整合问题,报类加载不到的错误,大概率是和其他组件 ...

  6. Springboot整合Elasticsearch报错availableProcessors is already set to [4], rejecting [4]

    Springboot整合Elasticsearch报错 今天使用SpringBoot整合Elasticsearch时候,相关的配置完成后,启动项目就报错了. nested exception is j ...

  7. spring整合junit报错

    1.Could not autowire field: private javax.servlet.http.HttpServletRequest 参考:https://www.cnblogs.com ...

  8. SpringMvc输入地址报错

    出现上面的错误如果不是路径的问题,就应该找环境的问题,我这里的问题是tomcat7+jdk6,应该是jdk7或以后的版本(因为是web socket) 对应的版本http://tomcat.apach ...

  9. springboot整合activiti报错[processes/]不存在解决方案

    springboot整合activiti时,启动抛异常 nested exception is java.io.FileNotFoundException: class path resource [ ...

随机推荐

  1. gif-drawable的使用及详解

    下载gif-drawable包和Demo的链接:http://pan.baidu.com/s/1eQxVKRo 本帖原创,转载的朋友请注明转载地址>:http://www.cnblogs.com ...

  2. 不须组件的NPOI插件 excel读取

    前提: 需要DLL  1.引用 using NPOI.SS.UserModel; using NPOI.XSSF.UserModel;//用于2007版本 using NPOI.HSSF.UserMo ...

  3. css3---线性渐变

    .example1 { width: 150px; height: 80px; background: -moz-linear-gradient( top,#ccc,#000); background ...

  4. linux内核Makefile整体分析

    转自:http://www.cnblogs.com/amanlikethis/p/3675486.html <请阅读原文> 一.概述 1.本文的意义 众多的资料(<嵌入式Linux应 ...

  5. webpack中dev-server不写contentBase时如何设置可以显示页面并且加载js

    今天学习了dev-server这个配置,中间遇到疑惑,我写了contentBase是可以走通,可以再localhost:8080看到页面并且正确加载bundle.js的,但是这个contentBase ...

  6. 【Android Widget】1.TextView

    1.创建可被点击的TextView 1.1 在xml中创建可被点击的TextView android:autoLink 是否将符合指定格式的文本转换成可单击的超链接. 属性值可以是如下几个属性值的一个 ...

  7. 使用openXML 不用插件导出excel

    注释很详细,不做解释了,有疑问可以提问 using System.IO; using System.Text; namespace iLIS.Common { /// <summary> ...

  8. TCP协议总结

    TCP的特性 TCP提供一种面向连接的.可靠的字节流服务 在一个TCP连接中,仅有两方进行彼此通信.广播和多播不能用于TCP TCP使用校验和,确认和重传机制来保证可靠传输 TCP给数据分节进行排序, ...

  9. linux文件系统下的特殊权限

    SUID, SGID, Sticky 1 权限 r, w, x user, group, other 2 安全上下文 前提:进程有属主和属组:文件有属主和属组: (1) 任何一个可执行程序文件能不能启 ...

  10. asp.net Socket的简单Web Server

    1.首先初始化socket,包含对端点以及对连接队列长度的初始化 IPAddress address = IPAddress.Loopback; IPEndPoint endPoint = ); So ...