com.fasterxml.jackson.databind.exc.InvalidDefinitionException


com.fasterxml.jackson.databind.exc.InvalidDefinitionException: 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.hnit.learning_shop.common.Result["data"]->java.util.ArrayList[0]->com.hnit.learning_shop.entity.XcUser_$$_jvst31f_0["handler"])

一般報這個異常大部分是由於沒有序列化。

在實體類上加上@JsonIgnoreProperties注解。

@JsonIgnoreProperties(value= {"handler"})

此注解是類注解,作用是json序列化時將Java bean中的一些屬性忽略掉,序列化和反序列化都受影響。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM