Hi
Just did some tests, it worked fine for me with LTW, but if I use plain Spring AOP, then I had some troubles as well.
At the end, I found that the reason is the AspectJ libraries, it only works with 1.5.2, but Spring 2.0rc2 includes the 1.5.1a.
After upgrading to the 1.5.2, the following sample works fine for me
Code:
@Around("execution(* *.*(..)) && @annotation(test)")
public Object testdata(ProceedingJoinPoint jp, TestAnnotation test) throws Throwable {
System.out.println("before .... " + test.name());
jp.proceed();
System.out.println("after .... " + test.name());
return null;
}
@Before("execution(* *.*(..)) && @annotation(TestAnnotation)")
public void testBefore() {
System.out.println("before");
}
@Before("execution(* *.*(..)) && @annotation(test)")
public void testBefore(TestAnnotation test) {
System.out.println("before2" + test.name());
}
Just tested a few different version, not very meaningful I agree ;-)
You also need the aspectj-autoproxy in the Spring context
Code:
<aop:aspectj-autoproxy />
Hope this works for you as well.
Guido