This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

This advice is not being executed however if i add this advice to a different method of a bean that is defined within a Spring context file then it works fine.

I noticed from the logs that 2 DefaultListableBeanFactory are used to create the beans, 1 for the application context beans and 1 for the beans defined for spring mvc within the x-servlet file.
The DefaultAdvisorAutoProxyCreator seems to be working on beans created within the application context (first bean factory) but not the second.

Does anyone know of anyway of adding advice to controller beans defined within you x-servlet.xml file? Preferably through configuration.

I have tried defining the advice beans within the x-servlet.xml file as well as configuring x-servlet.xml as a contextConfigLocation in web.xml but neither have worked.