引起的原因:
由于设置了@ResponseBody,要把对象转换成json格式,缺少转换依赖的jar包,故此错。
解决办法:
1 <dependency> 2 <groupId>org.codehaus.jackson</groupId> 3 <artifactId>jackson-core-asl</artifactId> 4 </dependency> 5 <dependency> 6 <groupId>org.codehaus.jackson</groupId> 7 <artifactId>jackson-mapper-asl</artifactId> 8 </dependency>
加入依赖的jar,jackson-core-asl-1.9.12.jar,jackson-mapper-asl-1.9.12.jar问题解决。
参考博客:http://jadethao.iteye.com/blog/1926525
Could not find acceptable representation,布布扣,bubuko.com
时间: 2024-12-06 10:41:33