当前位置:网站首页>使用oap切面导致controller被重复调用
使用oap切面导致controller被重复调用
2022-07-25 20:38:00 【森林迷了~鹿】
使用oap切面导致controller被被重复调用
背景:
在自测的时候发现某个很奇怪的问题,某个变量本该加1的变成了加2,debug后发现所有controller都被调用了两次,里面的方法也执行了两次
原因:
后面经过排查发现写切面的时候,在环绕通知里调用了两次joinPoint.proceed()
joinPoint.proceed():执行目标方法目标方法
定义的切点:
@Pointcut("execution(public * .......controller.*.*(..))")
可以看到execution表达式定义了所有controller包,及改包下所有类的所有方法,joinPoint.proceed()
解决方法:
修改原逻辑只执行一次joinPoint.proceed()
边栏推荐
- How to realize reliable transmission with UDP?
- 数据库清空表数据并让主键从1开始
- MySQL 日期【加号/+】条件筛选问题
- Google guava is just a brother. What is the real king of caching? (glory Collection Edition)
- [today in history] July 8: PostgreSQL release; SUSE acquires the largest service provider of k8s; Activision Blizzard merger
- QML combines qsqltablemodel to dynamically load data MVC "recommended collection"
- [today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born
- Jmeter——接口测试
- Yolov7 training error indexerror: list index out of range
- Why did I choose to become a network engineer after graduating from weak current for 3 months
猜你喜欢

Technology cloud report: more than zero trust, the wild hope of Parra's "Digital Security Cloud strategy"

4everland storage node portal network design

雷达水位计的工作原理及安装维护注意事项

Unity VS—— VS中默认调试为启动而不是附加到Unity调试

预处理指令

【高等数学】【5】定积分及应用

Clickhouse notes 02 -- installation test clickvisual

Go language go language built-in container
![[tensorrt] dynamic batch reasoning](/img/59/42ed0074de7162887bfe2c81891e20.png)
[tensorrt] dynamic batch reasoning
![[today in history] June 29: SGI and MIPS merged; Microsoft acquires PowerPoint developer; News corporation sells MySpace](/img/86/abeb82927803712a98d2018421c3a7.png)
[today in history] June 29: SGI and MIPS merged; Microsoft acquires PowerPoint developer; News corporation sells MySpace
随机推荐
leetcode-6129:全 0 子数组的数目
[MCU] 51 MCU burning those things
Embedded development: embedded foundation -- threads and tasks
【高等数学】【4】不定积分
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay
第六章 修改规范(SPEC)类
Struct, enum type and union
[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born
[paper reading] unpaired image to image translation using cycle consistent advantageous networks
2022.7.24-----leetcode.1184
Why did I choose to become a network engineer after graduating from weak current for 3 months
[today in history] July 19: the father of IMAP agreement was born; Project kotlin made a public appearance; New breakthroughs in CT imaging
Myormframeworkjdbc review and problem analysis of user-defined persistence layer framework, and thought analysis of user-defined persistence layer framework
ROS_ Rqt toolbox
Leetcode-146: LRU cache
Fanoutexchange switch code tutorial
How much memory does bitmap occupy in the development of IM instant messaging?
Introduction to several scenarios involving programming operation of Excel in SAP implementation project
Chapter VI modified specification (SPEC) class
[today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET