當我用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 ,我沒有試過也不建議這么做.