mybatis开启懒加载后com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.

    科技2025-04-19  11

    异常信息:

    com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactoryKaTeX parse error: Expected group after '_' at position 235: ….glc.bean.Route_̲$_jvst8ad_0[“handler”])

    解决方法

    关闭全局懒加载 <setting name="lazyLoadingEnabled" value="false"/>

    或关闭该查询的懒加载 fetchType=“eager”

    <collection ... fetchType="eager"> </collection> 返回的类加上注解

    @JsonIgnoreProperties(value = { “handler” })

    3. json转换器属性SerializationFeature.FAIL_ON_EMPTY_BEANS为false 详情:https://blog.csdn.net/justinytsoft/article/details/53575236

    Processed: 0.010, SQL: 8