Fastjson: spring mvc 整合 fastjson 问题

Created on 18 Nov 2016  ·  12Comments  ·  Source: alibaba/fastjson

spring 版本 是 4.0.9
fastjson版本是1.2.21

总报这个错
org.springframework.beans.factory.BeanCreationException: Could not autowire field
nested exception is org.springframework.beans.factory.CannotLoadBeanClassException:
Error loading class [com.alibaba.fastjson.support.spring.FastJsonpResponseBodyAdvice]
for bean with name 'fastJsonpResponseBodyAdvice' defined in URL
nested exception is java.lang.NoClassDefFoundError: org/springframework/web/servlet/mvc/method/annotation/ResponseBodyAdvice

Most helpful comment

找到原因了,是因为我扫描com的原因

All 12 comments

方便给个项目代码看看吗?

FastJsonpHttpMessageConverter4 看起来你是用了这个,但这需要spring 4.2+支持

这么高大尚的东西我不会使
要不你加我下QQ?

不方便加,麻烦提供配置信息吧,需要重现问题,谢谢。

呵呵,感觉到了。
不过谢谢你,选了一个低版本的就好了
谢谢

@dongyuanchun 你好,选了一个什么低版本?

@zhaoxilingcheng JAR与JAR的发版日期相近 就可以了

@dongyuanchun 没明白

是要更换哪个项目的版本吗

@zhaoxilingcheng 就是 JAR 的发布是有时间的
两个JAR 发版的时间相近 基本上就没啥问题

找到原因了,是因为我扫描com的原因

找到原因了,是因为我扫描com的原因

感谢你,我也是扫描了com包后不能用了

Was this page helpful?
0 / 5 - 0 ratings