Hi, I see, that explains it, the [with runtime test] is a check to determine if you are in the cflow.
> I am a little puzzled by what seem to be two calls to after(119 & 135). You have after advice, so it must intercept both the main exit paths (after returning) and any exception exit routes (after throwing). This one shows the call to the aspect prior to exiting via exception (athrow): > 119: invokevirtual #336; //Method > com/mycompany/myapp/aspects/tracing/myAspect.ajc$after$com_mycompany_myapp_aspects_tracing_myAspect$3$58016c43:()V > 122: aload 13 > 124: athrow Are you positive the trace calls you are expecting to be augmented are in the cflow of the myop() pointcut? Also that wherever myop() is matching is accessible to be woven by AspectJ? It will need to insert code at where myop() matches to tag the subsequent flows as being 'in the cflow of myop()'. You could try something simple like a separate aspect: aspect Foo { before(): myop() {} } Check if that aspect weaves ok or if it complains that it cannot access something in order to weave it. cheers Andy On 31 May 2011 12:52, Abhijit Inamdar <ainam...@intrepidls.com> wrote: > Thanks for your response Andy. > This is not a singleton aspect. It is actually percflow(myop()) { ... where > myop() is another pointcut. > > Here is a snippet of the woven output around a log statement("Entering > isValidRequest" in this case): > > 76: invokestatic #367; //Method > org/aspectj/runtime/reflect/Factory.makeJP:(Lorg/aspectj/lang/JoinPoint$StaticPart;Ljava/lang/Object;Ljava/lang/Object;)Lorg/aspectj/lang/JoinPoint; > 79: getstatic #379; //Field > ajc$tjp_4:Lorg/aspectj/lang/JoinPoint$EnclosingStaticPart; > 82: invokevirtual #355; //Method > com/mycompany/myapp/aspects/tracing/myAspect.ajc$before$com_mycompany_myapp_aspects_tracing_myAspect$4$48864b4c:(Lorg/aspectj/lang/JoinPoint;Lorg/aspectj/lang/JoinPoint$StaticPart;)V > 85: getstatic #34; //Field logger:Lorg/apache/log4j/Logger; > 88: ldc #48; //String Entering isValidRequest > 90: invokestatic #331; //Method > com/mycompany/myapp/aspects/tracing/myAspect.hasAspect:()Z > 93: ifeq 102 > 96: invokestatic #325; //Method > com/mycompany/myapp/aspects/tracing/myAspect.aspectOf:()Lcom/mycompany/myapp/aspects/tracing/myAspect; > 99: invokevirtual #328; //Method > com/mycompany/myapp/aspects/tracing/myAspect.ajc$before$com_mycompany_myapp_aspects_tracing_myAspect$2$58016c43:()V > 102: invokevirtual #50; //Method > org/apache/log4j/Logger.warn:(Ljava/lang/Object;)V > 105: goto 125 > 108: astore 13 > 110: invokestatic #331; //Method > com/mycompany/myapp/aspects/tracing/myAspect.hasAspect:()Z > 113: ifeq 122 > 116: invokestatic #325; //Method > com/mycompany/myapp/aspects/tracing/myAspect.aspectOf:()Lcom/mycompany/myapp/aspects/tracing/myAspect; > 119: invokevirtual #336; //Method > com/mycompany/myapp/aspects/tracing/myAspect.ajc$after$com_mycompany_myapp_aspects_tracing_myAspect$3$58016c43:()V > 122: aload 13 > 124: athrow > 125: nop > 126: invokestatic #331; //Method > com/mycompany/myapp/aspects/tracing/myAspect.hasAspect:()Z > 129: ifeq 138 > 132: invokestatic #325; //Method > com/mycompany/myapp/aspects/tracing/myAspect.aspectOf:()Lcom/mycompany/myapp/aspects/tracing/myAspect; > 135: invokevirtual #336; //Method > com/mycompany/myapp/aspects/tracing/myAspect.ajc$after$com_mycompany_myapp_aspects_tracing_myAspect$3$58016c43:()V > > > I am a little puzzled by what seem to be two calls to after(119 & 135). > > > > ________________________________________ > From: aspectj-users-boun...@eclipse.org [aspectj-users-boun...@eclipse.org] > on behalf of Andy Clement [andrew.clem...@gmail.com] > Sent: Monday, May 30, 2011 8:56 AM > To: aspectj-users@eclipse.org > Subject: Re: [aspectj-users] Puzzling problem using AspectJ > > Hi, > > So you are not loadtime weaving, you are just compile time weaving. > The weaveinfo messages indicate the bytecode is being modified. I > guess you could check the woven output from the compile and verify the > calls to the logger have been advised. Using 'javap -private > -verbose' against a class in the woven output you should see wherever > there is a call to getLogger there is a call to the advice? > > Actually, one thing does seem unusual. Is your pointcut definetly just this: > > call(* org.apache.log4j.Logger.*(..)) && !within(*..*Aspect); > > and in a singleton aspect? > > Because that can be fully statically matched, so I don't understand > why your weaveinfo message is suffixed with '[with runtime test]'. If > the runtime test (whatever it is) is failing it will not be running > your advice. If you want to post the snippet of bytecode around the > calls to getLogger we can check what the runtime test is. > > Andy > > > _______________________________________________ > aspectj-users mailing list > aspectj-users@eclipse.org > https://dev.eclipse.org/mailman/listinfo/aspectj-users > _______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users