Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] problem weaving cflow pointcut aspects into jar file

Hi all
(I am currently using AspectJ 1.5.0 M5, Released 16th November, 2005  with JDK 1.4.2_06-b03)

I am using iajc to weave tracing aspects that uses cflow pointcuts into previously compiled source files that are in a jar file. If my tracing aspects do not contain the cflow poincuts, everything works fine.  If they contain cflow pontcuts , I get this error when executing the jar file: 

Exception in thread "main" java.lang.NoSuchFieldError: ajc$cflowCounter$0


This is the ant task script I am using to weave the aspects: (the ant task executes without any problems)

    <target name="inject">
        <mkdir dir="dest"/>
	<iajc outjar="dest/rulesparser-traceable.jar">
	    <inpath> 
	        <pathelement location="target/rulesparser-1.0-SNAPSHOT.jar"/>		
	    </inpath>
	    <aspectpath>
	        <pathelement location="tracing.jar"/>
	    </aspectpath>
       <classpath>	       
       		<pathelement location="${aspectj.dir}/lib/aspectjrt.jar"/>
        </classpath>		   
	    
	</iajc>
    </target>

// --this the pointcut which causes the above exception

 	protected pointcut tracePoints() : (
        !cflow(execution(String *.toString()))
            && !cflowbelow(within(JoinPointTraceAspect))
            && !execution(* *.hashCode())
            && !execution(* *.checkTransaction())
            && (execution(* *.* (..)))
            );


/*  This aspect does not cause the above error  but is not enough as it does not use cflow pointcuts

 	protected pointcut tracePoints() :
        	!execution(String *.toString())
            && !within(JoinPointTraceAspect)
            && !execution(* *.hashCode())
            && !execution(* *.checkTransaction())
            && execution(* *.* (..));

*/

Could anyone tell me what I could do to fix it ?  Is this a known issue ?

Regards
-manish


Back to the top