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中的一些屬性忽略掉,序列化和反序列化都受影響。