JPA解决问题经验v2021

2021-06-12  本文已影响0人  沈_ac89

1、com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer
原因:数据中存在null值导致无法正常序列化
解决:在实体类中添加@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})

2、java.lang.IllegalStateException: No primary or single public constructor found for interface java.util.List - and no default constructor found either
原因:controller层无法自动接收List参数
解决:需要通过vo对象进行参数接收

上一篇 下一篇

猜你喜欢

热点阅读