Spring 项目中配置spring.aop.auto


项目中报异常,信息如下:

The mapped handler method class XXXX is not an instance of the actual endpoint bean class XXXX

出现这种异常,很有可能是代理方式错误导致的。应该强制要求程序采用一种方式,要么是jdk基于接口的代理,要么是基于类的代理。

spring.aop.proxy-target-class=true
#自动代理关闭
spring.aop.auto=false

proxy-target-class属性的作用
true表示基于类的代理将使用,false表示默认使用Jdk基于接口的代理

参考地址:

https://blog.csdn.net/Anenan/article/details/89022003


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM