java.lang.IllegalArgumentException: No converter found for return value of type:
来源:互联网 发布:c语言大小写转换a变a 编辑:程序博客网 时间:2024/06/06 02:13
这是因为springmvc默认是没有对象转换成json的转换器的,需要手动添加jackson依赖。
在pom文件中加入
<properties><jackson.version>2.4.2</jackson.version></properties> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency>
如果还是没有解决,则进行以下步骤
在springmvc配置文件中进行如下配置
<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>
阅读全文
0 0
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- 【已解决】java.lang.IllegalArgumentException: No converter found for return value of type: class java.uti
- 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- java.lang.IllegalArgumentException: No converter found for return value of type: class
- 记录下报错:java.lang.IllegalArgumentException: No converter found for return value of type: class
- springmvc框架报错java.lang.IllegalArgumentException: No converter found for return value of type: class
- java.lang.IllegalArgumentException: No converter found for return value of type
- java.lang.IllegalArgumentException: No converter found for return value of type:class 解决方案
- java.lang.IllegalArgumentException: No converter found for return value of type
- 关于java.lang.IllegalArgumentException: No converter found for return value of type: class 的问题解决
- springboot错误 java.lang.IllegalArgumentException:No converter found for return value of type
- java.lang.IllegalArgumentException: No converter found for return value of type:
- 解决java.lang.IllegalArgumentException: No converter found for return value of type:
- SpringMVC 返回json数据报错IllegalArgumentException: No converter found for return value of type:xxx
- 解决java.lang.IllegalArgumentException: No converter found for return
- 关于the account is locked的问题
- 带重力效果的登录框
- MATLAB 生成 HOG+SVM训练所需的txt文件
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- 读《JAVA 核心技术》卷I 基础知识(原书第10版)
- java.lang.IllegalArgumentException: No converter found for return value of type:
- Capstone训练营10
- github使用gitbash推送下载
- 20171219
- fopen和fopen_s
- Oracle执行计划不走索引的原因总结
- JS之Math对象
- 剑指offer 编程题(21):二叉树层次打印
- pandas中文速查手册