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