hibernate级联查询懒加载时json错误解决
Could not write content: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer
hibernate延时加载
因为jsonplugin用的是Java的内审机制.hibernate会给被管理的pojo加入一个hibernateLazyInitializer属性,jsonplugin会把hibernateLazyInitializer也拿出来操作,并读取里面一个不能被反射操作的属性就产生了这个异常.
然后在类型上面将hibernateLazyInitializer进行忽略。
添加:@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })