Manuel Jordan opened SPR-14753 and commented
Hello
According with the following:
Why the class annotated with @EnableAspectJAutoProxy and scanned through RootApplicationContext is practically ignored by ServletApplicationContext?
Exists two possible solutions:
- the class annotated with
@EnableAspectJAutoProxy should be scanned through ServletApplicationContext instead
- the class annotated with
@EnableAspectJAutoProxy should be scanned twice, by RootApplicationContext and ServletApplicationContext
I think each approach has a drawback
Furthermore from the current answer:
Seems that BeanFactoryPostProcessor (which is @EnableAspectJAutoProxy in your case) from parent context not applied to child contexts. To make it work in production you must explicitly define @EnableAspectJAutoProxy in child context too
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:
Referenced from: commits 0e734d8, 13c2134
Backported to: 4.3.15
Manuel Jordan opened SPR-14753 and commented
Hello
According with the following:
Why the class annotated with
@EnableAspectJAutoProxyand scanned throughRootApplicationContextis practically ignored byServletApplicationContext?Exists two possible solutions:
@EnableAspectJAutoProxyshould be scanned throughServletApplicationContextinstead@EnableAspectJAutoProxyshould be scanned twice, byRootApplicationContextandServletApplicationContextI 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 PracticesThanks 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:
@EnableSchedulingneeds to be redeclared for each application contextReferenced from: commits 0e734d8, 13c2134
Backported to: 4.3.15