zoukankan      html  css  js  c++  java
  • org.springframework.http.converter.json.MappingJacksonHttpMessageConverter

    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

    1. 查找替换所有XML中名字
    2. 同时加入最新的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-core</artifactId>
                    <version>2.8.5</version>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                    <version>2.8.5</version>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                    <version>2.8.5</version>
                </dependency>'''
    

    http://www.cnblogs.com/chry/p/6283483.html
    http://www.sojson.com/blog/145.html

  • 相关阅读:
    核心编程(第七章)
    核心编程答案(第六章)
    spring aop配置切点执行了两次的原因
    spring AOP使用 xml配置
    有关于时间戳的pgsql操作
    sql 中 limit 与 limit,offset连用
    学习大数据笔记day1
    Java实现各种排序
    关于java洗牌发牌小程序
    flex.css
  • 原文地址:https://www.cnblogs.com/Bouger/p/7152670.html
Copyright © 2011-2022 走看看