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

posted @ 2021-06-07 09:25  八方鱼  阅读(1238)  评论(0)    收藏  举报