Advising beans in a parent context
I am trying to set up a simple before advice on a method:
This configuration and advice works fine in the root application context, where I actually have a bean of class 'com.package.AdvisedClass'. But when I move this to a child application context (a dispatcher servlet context), it no longer creates the AOP proxy!! Why not? Is this something that's theoretically possible or do all advised classes have to be in the same context file?
<aop:aspect id="myAspect" ref="adviceBean">
<aop:before method="before" pointcut="execution(* com.package.AdvisedClass.advisedMethod(..))"/>
<bean id="adviceBean" class="..." autowire="byName"/>