Spring3X升级到Spring4X时,出现的问题
1.1、异常描述
Description Resource Path Location Type
Class 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter' not found [config set: testweba/web-context] spring-mvc.xml
/testweba/src/main/resources line 13 Spring Beans Problem
1.2、原因分析
Spring3升级到Spring4时, 运行时出现找不到MappingJacksonHttpMessageConverter的情况
原因是Spring 3.x 和4.X处理JSON的一个类不一样,而这个东西又配置在xml文件中,所以编译时又无法发现
1.3 解决办法
spring3.x是org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
spring4.x是org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
- 查找替换所有XML中名字
- 同时加入最新的FastJackson依赖
2.1 异常描述
Description Resource Path Location Type
Build path is incomplete. Cannot find class file for com/fasterxml/jackson/core/JsonGenerator spring-mvc.xml /testweba/src/main/resources line 13 Spring AOP Problem
2.2 原因分析
Spring 4.x 需要依赖的相关FastJackson jar
2.3 解决办法
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.8</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.8</version>
</dependency>
或者直接引入总的依赖包名
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.8.8</version>
</dependency>
Spring3X升级到Spring4X时,出现的问题的更多相关文章
- 关于升级程序版本时version与build修改的问题
CHENYILONG Blog 关于升级程序版本时version与build修改的问题 #问题#从V1.0升级到V1.0.1.version是一定要改的,那么build需要修改吗? #解答#一般习惯上 ...
- windows7系统下升级到IE11时无法使用F12开发人员工具的解决办法
windows7系统下升级到IE11时,发现F12开发人员工具无法使用,打开都是空白的 解决办法,就是下载IE11的补丁,下载地址为:https://www.microsoft.com/zh-CN/d ...
- tomcat6升级到7时400问题,以及url带有汉字时出错。
tomcat6升级到7时400问题: 在文件catalina.properties后加入tomcat.util.http.parser.HttpParser.requestTargetAllow=|. ...
- django升级2.1python升级3.7时出现的错误:"trying to load '%s': %s" % (entry[1], e) django.template.library.InvalidTemplateLibrary:
django升级2.1python升级3.7时出现如下的错误: "trying to load '%s': %s" % (entry[1], e) django.template. ...
- 针对电信乌龙事件的深度测试: 广州电信错误将深圳地区189的号码在3G升级4G申请时从广州网厅发货,造成深圳用户收到4G卡后无法激活,深圳电信找不到订单
广州电信错误将深圳地区189的3G升级4G申请从中国电信广州网厅发货(智能卡号:8986 1114 9002 0851 742X S 电话号码 189),造成用户收到4G卡后无法激活,深圳电信找不 ...
- 升级到tomcat8时Artifact SpringMvcDemo:war exploded: Server is not connected. Deploy is not
The method getDispatcherType() is undefined for the type HttpServletRequest 升级到tomcat8 http://segmen ...
- linux升级安装openssh时出现依赖冲突
通过如下方式下载到openssh安装包 https://www.cnblogs.com/qq931399960/p/11120429.html -rwxrwxrwx. root root Jul : ...
- iphone5升级到iOS7时出现“This device isn't eligible for the requested build”错误
因为工作的需要我需要把自己的手机升级到iOS7,安装苹果的升级顺序总是报This device isn't eligible for the requested build错误,搜索相关的文章我的错误 ...
- Vs2010项目升级到Vs2015时的一些修改
之前的C++/cli项目, Civil 3D版本为2014, 现在需要升级到2018版, 在升级的过程中遇到了一些问题: 为了备忘, 记录如下: Vcproj文件中进行了一些修改, 为了跟多版本项目的 ...
随机推荐
- test20190320
全连 \(n\leq 10^6\) ,保证答案在 \(long\ long\) 范围内. 比较浅显的 \(dp\ ?\) 记 \(f[i]\) 表示考虑前 \(i\) 个音符,其中第 \(i\) 个 ...
- lydsy个人代码.zip
/s/12vaj9vUNLMlEPxlhw4xRwA ryap 感谢@yirannn 省选前++rp
- dda的fpga实现(转载)
The general approach using DDAs will be to simulate a system of first-order differential equations, ...
- maven的pom.xml文件配置说明
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
- Sprint第一个冲刺(第一天)
一.Sprint介绍 我们这次的团队项目是做<餐厅到店点餐系统>APP版,暂时不是基于用户需求来做的,但后期会进行用户需求调查,完善我们的软件.现在正在做一些前期准备,在团队合作上还缺乏一 ...
- phoenix 使用activerecord模式框架ecto 访问数据库
备注: 需要先安装mysql 以及phoenix 框架,测试使用的是docker 进行安装,具可以参考代码 1. 创建项目 mix phx.new first --database mys ...
- SpringBoot 接收 单个String入参之解决方案
场景: 在做接口时,有的时候,接口入参只需要一个参数,如果将一个参数封装成一个对象很麻烦,故有了以下方式: 思路: spring自带的参数解析器貌似是不具备这个能力的,所有自定义 方式方法: 1.定义 ...
- 笔记:配置 webpack dev server
笔记:配置 webpack dev server 安装 webpack-dev-server 组件 配置 webpack.config.js 配置 增加 html-webpack-plugin 组件 ...
- hadoop之 Hadoop2.2.0中HDFS的高可用性实现原理
在Hadoop2.0.0之前,NameNode(NN)在HDFS集群中存在单点故障(single point of failure),每一个集群中存在一个NameNode,如果NN所在的机器出现了故障 ...
- OPC接口相关资料地址
OPC官方网址:https://opcfoundation.org/ OPC中国官网: http://www.chinaopc.org/ ------------------------------- ...