-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advice argument binding failure when enabling AspectJ mode for transactions #34316
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Joshua Chen <[email protected]>
Hi @JoshuaChen, Congratulations on submitting your first PR for the Spring Framework!. 👍
How did you come to the conclusion? Please provide an example that worked with a previous version of AspectJ and began to fail with a recent version of AspectJ (for example 1.9.22.1 which we currently support). In addition, you will need to introduce a JUnit-Jupiter based test in the test suite that covers this scenario. Thanks |
hi~
AspectJ should return JoinPoint in the first parameter. However, when I ran and debugged it in my own demo app, I saw that it returned JoinPoint in the last element of getParameterTypes(). Additionally, please give me some time to provide unit tests, and I will try to complete them. |
Signed-off-by: Joshua Chen <[email protected]>
hi~ @sbrannen You are correct, this exception is not related to the AspectJ version. I found that version 6.1.6 does not trigger the exception, but version 6.1.7 does. The change to isAspect() in version 6.1.7 (#32793) opened Pandora’s box. The “Advice argument binding failure” issue has always existed; it just wasn’t triggered before. In version 6.1.6 and earlier (apologies, I couldn’t test all versions), there was no handling for the corresponding AspectJ method, so it “worked normally.” Additionally, unit tests have been added. Please help me review the code. |
Signed-off-by: Joshua Chen <[email protected]>
After enabling
@EnableTransactionManagement(mode = AdviceMode.ASPECTJ, proxyTargetClass = true)
, an exception occurs.The issue seems to be that AspectJ has changed its logic, and the first element in
aspectJAdviceMethod.getParameterTypes()
no longer returnsJoinPoint
, causing the exception.