错误详情:
org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
原因:Json把懒加载也作为POJO进行序列化了。
解决方法:在该实体类的所有关联集合类上加上
@JsonIgnoreProperties({“ hibernateLazyInitializer”,“ handler”})