Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Advising javax.persistence.EntityManager with AspectJ not working

Hello,

I am trying to advise javax.persistence.EntityManager with AspectJ and Spring. It just does not work: no error and no "caught" on the console...

Here is my aspect:

package trc.suivi.aspects;

public aspect EventManagerAspect {

   
public EventManagerAspect() {}

    pointcut catchIt
() : (execution(* javax.persistence.EntityManager.persist(..)));

    after
() returning: catchIt() {
       
System.out.println("caught");
   
}

}

Here is how I configured my aspect in Spring:

<bean class="trc.suivi.aspects.EventManagerAspect" factory-method="aspectOf"/>
Can anyone please help?
Regards,
Julien.

Back to the top