org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$EnhancedResultObjectProxyImpl and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.


當我用Springboot和mybatis進行延遲加載時候報出如下的錯誤:

org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$EnhancedResultObjectProxyImpl and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

這里我的解決方法是在yml的配置中設置:

spring:
  jackson:
    serialization:
     FAIL_ON_EMPTY_BEANS: false

同理在properties中設置為:

spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false

這里搜索到的很多說將bean中屬性為private,改為public ,我沒有試過也不建議這么做.


免責聲明!

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



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