使用AopContext.currentProxy()时报错了.如下
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.

看意思就是 没用设置 exposeProxy = true 这个参数.

解决:

@EnableAspectJAutoProxy(exposeProxy = true,proxyTargetClass = true)

更多详情可以参考

https://blog.csdn.net/mameng1988/article/details/85548812

https://blog.csdn.net/rtuujnncc/article/details/68926465

https://blog.csdn.net/z69183787/article/details/45622821/

https://blog.csdn.net/daofengsuoxiang/article/details/103027280

等等

另,通过this调用方法时,事务的失效也是因为这个原因.this调用拿到的并不是代理类,所以失效了.

Spring AOP报错Set ‘exposeProxy‘ property on Advised to ‘true‘ to make it available问题相关推荐

  1. Spring aop报错:com.sun.proxy.$Proxyxxx cannot be cast to yyy

    在使用Spring AOP时,遇到如下的错误: Exception in thread "main" java.lang.ClassCastException: com.sun.p ...

  2. Spring AOP 报错 Exception encountered during context initialization - cancelling refresh attempt[已解决]

    三月 19, 2018 4:01:40 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh ...

  3. vue 报错 Cannot read property ‘__ob__‘ of undefined的解决方法

    vue 报错 Cannot read property '__ob__' of undefined的解决方法 参考文章: (1)vue 报错 Cannot read property '__ob__' ...

  4. 解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp

    解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp ...

  5. 事件监听一直报错Cannot set property 'display' of undefined

    为什么80%的码农都做不了架构师?>>>    css ↓ .wechatBtn {position: relative;} .wechat {position: absolute; ...

  6. DateTimePicker 日期时间选择器报错 Cannot read property ‘getHours‘ of undefined, 无法选中`[__ob_: observer__]`时做判断

    我在一次开发中遇到了这个情况:使用DateTimePicker 日期时间选择器,出现无法选中, 报错 Cannot read property 'getHours' of undefined, 这个原 ...

  7. Vue开启Gzip打包异常:webpack打包报错Cannot read property ‘emit‘ of undefined

    Vue开启Gzip打包异常:webpack打包报错Cannot read property 'emit' of undefined 相关代码 const CompressionPlugin = req ...

  8. Spring data报错:Inferred type 'S' for type parameter 'S' is not within its bound;

    Spring data报错:Inferred type 'S' for type parameter 'S' is not within its bound; 参照 org.springframewo ...

  9. Spring Boot 报错ThreadPoolTaskExecutor : Shutting down ExecutorService ‘applicationTaskExecutor‘

    问题 Spring Boot 报错ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 原因 ...

  10. 启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程

    启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程 大概率是缺少了一下依赖 <dependency><g ...

最新文章

  1. C# Redis实战(六)
  2. Python解决ModuleNotFoundError: No module named ‘Queue‘的问题
  3. Python3爬虫-01-简单网页爬取
  4. Qt学习笔记之MySQL数据库
  5. 如何通过离线安装的方式让sublime text具有TypeScript语法高亮的功能
  6. Vue2.0用户权限控制解决方案
  7. 对话DDM:分布式数据库中间件全解析
  8. QCC3005 实现iphone手机banner显示电量图标【续】
  9. 低成本,高效率,更成熟的实时数据采集方案来了
  10. Excel 2010 VBA 入门 126 批量设置控件属性
  11. 微信小程序中集成有赞UI自定义Tabbar组件
  12. Cell Stem Cell | 动物所刘光慧等显示年轻血液可逆转衰老进程
  13. JVM之jstat命令
  14. juniper SSG防火墙与飞塔防火墙配置点到点IPSEC ***
  15. public,static,private,protected的用法
  16. Bugku MISC 粉色的猫
  17. windows7 系统搭建webdav服务
  18. 原型图、交互设计、UI图,到底啥关系
  19. 华为ws832虚拟服务器,玩的就是真实力!华为路由WS832实测体验
  20. XPS 13 9360 升级SSD, 迁移WIN10系统, 以及Acronis使用和Win10PE系统安装流水

热门文章

  1. SQL语言-更新操作命令
  2. 河南星年华计算机科技有限公司怎么样,莫让年华逝流水
  3. 什么是Android SDK
  4. aop aspectj autoproxy / 的作用
  5. nfc和红外线的区别_比较NFC支付、蓝牙支付、红外线支付技术的优缺点
  6. R^2(可决系数)为负分析
  7. RouterOS 重置密码
  8. cocos creator使用anysdk接入admob广告教程
  9. 稀疏矩阵存储格式总结+存储效率对比:COO,CSR,DIA,ELL,HYB
  10. X11-forwarding笔记