"exception": "org.springframework.http.converter.HttpMessageNotWritableException",
"message": "Could not write content: No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$EnhancedResultObjectProxyImpl and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.chinamcloud.cms.api.dto.ReturnDto[\"returnData\"]->java.util.ArrayList[0]->com.chinamcloud.cms.repository.vo.CommentListVO_$$_jvst7cb_0[\"handler\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$EnhancedResultObjectProxyImpl and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.chinamcloud.cms.api.dto.ReturnDto[\"returnData\"]->java.util.ArrayList[0]->com.chinamcloud.cms.repository.vo.CommentListVO_$$_jvst7cb_0[\"handler\"])",
http://moguichun.com/2016/04/18/SpringMVC-Mybatis%E6%95%B4%E5%90%88%E8%BF%94%E5%9B%9EJSON%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E7%9A%84Could-not-write-content-No-serializer-found-for-class-%E9%94%99%E8%AF%AF%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95/
嗯,用VO对输出可以的实体类有一个属性是其它实体类的类型,mybatis默认使用了延迟加载,导致在处理这个类的时候某些属性不能被序列化,因此造成了上述原因。https://github.com/mybatis/mybatis-3/issues/570
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。