java.lang.IllegalArgumentException: No converter found for return value of type:
2017-12-19 16:44
621 查看
这是因为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>
相关文章推荐
- 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.util
- 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.util.ArrayList的问题
- 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.uvvvvv
- java.lang.IllegalArgumentException: No converter found for return value of type: class XXX.XXXX
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- 170524、java.lang.IllegalArgumentException: No converter found for return value of type异常解决
- 【已解决】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.Has
- Request processing failed; nested exception is java.lang.IllegalArgumentException: No converter found for return value of type: class cn.e3mall.pojo.TbItem
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- springboot错误 java.lang.IllegalArgumentException:No converter found for return value of type
- 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
- 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 Person