@Aspect advice is never called
Hi
I have a simple scenario where I want to use an @Aspect for some operation @AfterReturning.
My code:
Code:
package com.foo.bar;
...
@Aspect
@Component
public class MyAspect implements IMyAspect
{
@Pointcut("execution(* *.MyService.performOperation(..)) && args(op)")
public void performOperation(MyOperation op) { }
@AfterReturning("performOperation(op)")
public void afterReturningPerformOperation(MyOperation op) {
... // never reaches here
}
}
My config:
Code:
<context:component-scan base-package="com.foo.bar" />
<aop:aspectj-autoproxy />
The MyAspect bean is created for sure (loaded with application context and used in different beans). Also I know that the @Pointcut itself is detected because the PointcutParser parses the expression successfully (it also means that the expression is reflecting at least one actual method?)
The problem is that no matter what I do, the @AfterReturning method is never called. I don't know what's wrong, it was based on the "Spring in Action 3rd edition" book example and I don't think the modifications had any significance (mainly names).
The "MyService.performOperation(..)" method is @Transactional, if matters.