首页 > 其他 > 详细

Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available.

时间:2020-07-07 09:59:33      阅读:591      评论:0      收藏:0      [点我收藏+]

出现这个报错通常是因为使用了AopContext.currentProxy()函数却没有添加相应的配置造成的。

通过注解添加配置(加在类上):

@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)

或通过xml配置文件添加配置:

<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"/>

这样就解决了报错问题。

 

"祝你早安午安晚安。"

Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available.

原文:https://www.cnblogs.com/yanggb/p/13227072.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!