Type definition error: [simple type, class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactoryEnhancedResultObjectProxyImpl];nestedexceptioniscom.fasterxml.jackson.databind.exc.InvalidDefinitionException:Noserializerfoundforclassorg.apache.ibatis.executor.loader.javassist.JavassistProxyFactoryEnhancedResultObjectProxyImpl]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactoryEnhancedResultObjectProxyImpl];nestedexceptioniscom.fasterxml.jackson.databind.exc.InvalidDefinitionException:Noserializerfoundforclassorg.apache.ibatis.executor.loader.javassist.JavassistProxyFactoryEnhancedResultObjectProxyImpl and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.ruoyi.framework.web.page.TableDataInfo[“rows”]->com.github.pagehelper.Page[0]->com.ruoyi.project.system.student.domain.ZStudent_$$_jvst12a_0[“handler”])
fetchType="eager"
<resultMap id="RoleMap" type="com.hyper.netman.entity.business.BackstageRole">
<result column="id" property="id"/>
<result column="role_name" property="roleName"/>
<result column="role_desc" property="roleDesc"/>
<result column="create_time" property="createTime"/>
<result column="modify_time" property="modifyTime"/>
<!--需要关闭懒加载,不然对象不是原来的对象-->
<collection property="resources" column="id" javaType="list" fetchType="eager" select="getRolesMenus"/>
</resultMap>
@JsonIgnoreProperties(value = { "handler" })
public class BackstageRole{}
SerializationFeature.FAIL_ON_EMPTY_BEANS为false
spring:
jackson:
serialization:
FAIL_ON_EMPTY_BEANS: false
Java Mybatis懒加载报错末尾显示_$$_jvst12a_0["handler"])的解决方案
原文:https://www.cnblogs.com/jockming/p/12970289.html