java.lang.IllegalArgumentException: No converter found for return value of type: class
2016-06-01 11:43
916 查看
原文地址http://stackoverflow.com/questions/33832735/spring-boot-application-no-converter-found-for-return-value-of-type
原因:请求返回的数据无法转换,需要添加如下配置
1.在pom.xml 里添加
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.3</version>
</dependency>
2.在spring-mvc 配置文件添加下面的配置,不使用默认的配置
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
</mvc:message-converters>
</mvc:annotation-driven>
原因:请求返回的数据无法转换,需要添加如下配置
1.在pom.xml 里添加
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.3</version>
</dependency>
2.在spring-mvc 配置文件添加下面的配置,不使用默认的配置
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
</mvc:message-converters>
</mvc:annotation-driven>
相关文章推荐
- SystemUI浅析
- Light oj-1100 - Again Array Queries,又是这个题,上次那个题用的线段树,这题差点就陷坑里了,简单的抽屉原理加暴力就可以了,真是坑~~
- Android 子线程更新UI:handle和runOnUiThread()
- pch文件导入uikit报错 could not build module 'uikit'
- 【iOS开发-91】GCD的同步异步串行并行、NSOperation和NSOperationQueue一级用dispatch_once实现单例(转载)
- Codeforces 645E Intellectual Inquiry (贪心+DP)
- Tair-淘宝自主开发的一个分布式key/value存储系统
- j2ee四大作用域pagecontext,request,session,ServletContext(转)
- 三维箭头quiver3的用法
- UEFI BIOS模式下Windows系统启动过程以及引导文件修复方法
- Android标题透明沉浸式UI
- uestc水题CD Making
- MySQL 导入的问题 Lost connection to MySQL server during query
- QuickWebApi:使用Lambada方式,完成对WebApi的开发和调用。
- SQLiteDatabase中query、insert、update、delete方法参数说明
- 解决 按钮响应延时[UIScrollView 和 UITableViewCell 中的子视图触摸事件延时]
- java.lang.ClassCastException: org.hibernate.impl.SQLQueryImpl cannot be cast to java.util.List
- 浏览器标准模式(standars mode)与怪异模式(Quirks mode)浅析
- layer-list简单使用教程
- poj 3094 Quicksum