cancel
Showing results for 
Search instead for 
Did you mean: 

AOP Aspect not working

0 Kudos
1,587

Hi All, I wrote an aspect to intercept customer model method. Here is the code. I don't see the aspect method getting called. Please correct me if i am doing wrong.

Aspect Class:

 @Aspect
 @Component
 public class CustomerCustomAspect{
 
     @Pointcut("execution(* de.hybris.platform.core.model.user.CustomerModel.getCard(..))") 
     public void theExample() {
         //
     }
     
         
     @Around("theExample()")
     public void getCard(ProceedingJoinPoint  joinPoint) throws Throwable {
         joinPoint.proceed();
         System.out.println("********************************came");
     }
     
 }

aop.xml:

 <weaver options="-Xset:weaveJavaxPackages=true">
     <include within="de.hybris.platform.core.model.user.." />
     <include within="src.myextension.core.customer.." />
 </weaver>
 <aspects>
     <aspect name="src.myextension.core.customer.CustomerCustomAspect" />
 </aspects>


local.properties -javaagent:./bin/platform/ext/core/lib/aspectjweaver-1.9.0.RC2.jar -Dorg.aspectj.tracing.enabled=false -Daj.weaving.verbose=false -Dorg.aspectj.weaver.showWeaveInfo=false

View Entire Topic
0 Kudos

Hello,

You may try to change Pointcut like below.

     @Pointcut("execution(* de.hybris.platform.core.model.user.CustomerModel*.getCard(..))")