当使用AopContext.currentProxy()代理当前service的时候,报Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available.
解决方案:
1、在代理的类上添加注解
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
2、在xml配置文件上添加
<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"/>