在使用SpringMVC和jackson时,如果报错No converter found for return value of type
解决方案:
- 检查有没有jackson-core,jackson-annotations,jackson-databind这三个包
- 检查SpringMVC与Jackson的兼容问题:spring4.2 版本冲突,不兼容jackson2.7 , 改用jackson 2.6,Sping5以上的要搭配2.9.X以上的Jackson
- 检查是否配置
<mvc:annotation-driven></mvc:annotation-driven>
并导入http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd
参考
https://www.cnblogs.com/qinglangyijiu/p/7742344.html
https://blog.youkuaiyun.com/qq_25221835/article/details/82895316
https://blog.youkuaiyun.com/kuguhuan/article/details/106137398