ensure that AopContext.currentProxy() is invoked in the same thread as the AOP invocation context(示例
Posted jingzhi-sksk
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ensure that AopContext.currentProxy() is invoked in the same thread as the AOP invocation context(示例相关的知识,希望对你有一定的参考价值。
Cannot find current proxy: Set ‘exposeProxy‘ property on Advised to ‘true‘ to make it available, and ensure that AopContext.currentProxy() is invoked in the same thread as the AOP invocation context.
在spring boot 的启动类上加上注解: @EnableAspectJAutoProxy(proxyTargetClass=true,exposeProxy=true) 也可以
@EnableAspectJAutoProxy(proxyTargetClass=false,exposeProxy=true)
proxyTargetClass=false 表示用jdk动态代理 为true 表示 cglib动态代理
以上是关于ensure that AopContext.currentProxy() is invoked in the same thread as the AOP invocation context(示例的主要内容,如果未能解决你的问题,请参考以下文章