Spring MVC and AOP: @EnableAspectJAutoProxy needs to be redeclared for each application context [SPR-14753] #19319
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: task
A general task
Milestone
Manuel Jordan opened SPR-14753 and commented
Hello
According with the following:
Why the class annotated with
@EnableAspectJAutoProxy
and scanned throughRootApplicationContext
is practically ignored byServletApplicationContext
?Exists two possible solutions:
@EnableAspectJAutoProxy
should be scanned throughServletApplicationContext
instead@EnableAspectJAutoProxy
should be scanned twice, byRootApplicationContext
andServletApplicationContext
I think each approach has a drawback
Furthermore from the current answer:
If that is true is it a bug or is the expected behaviour?
Your explanation about this situation with the solution (extra configuration if exists) should be added in the Spring Framework Reference Documentation, it for the rest of the community.
I think here we have a situation about
Best Practices
Thanks by your understanding.
Affects: 4.3 GA
Reference URL: http://stackoverflow.com/questions/39694633/spring-mvc-and-aop-pointcuts-for-controllers-only-works-in-testing-and-not-fo
Issue Links:
@EnableScheduling
needs to be redeclared for each application contextReferenced from: commits 0e734d8, 13c2134
Backported to: 4.3.15
The text was updated successfully, but these errors were encountered: