arrohith (4) [Avatar] Offline
#1
I am trying my hand at AspectJ, i have a working Eclipse 2.1.1 and AspectJ 1.1.4
plug-in. With the pointcut here in an aspect named TestLogR1,

pointcut tracePoints() : !within(TestLogR1) && !cflowbelow(execution(*
java..*.*(..)));

i want to exclude all the java.* method calls and their executions being logged onto my
console, but when i try running the main class, i get an exception that reads:

java.lang.NoSuchFieldError: ajc$cflowStack$1
at com.me..[main-class].<clinit>([main-class].java)
Exception in thread "main"

If i want to use execution() pointcut like this,

pointcut tracePoints() : !within(TestLogR1) && !(execution(* java..*.*(..)));

i get an exception that reads:

java.lang.NoSuchMethodError:
com.me.TestLogR1.ajc$after$com_me_TestLogR1$264(Lorg/aspectj/lang/JoinPoint; ) V
at com.me..[main-class].<clinit>([main-class].java)
Exception in thread "main"

Please let me know where i am going wrong.

Regards,
Rohith.
ramnivas (171) [Avatar] Offline
#2
Re: Exceptions while running woven code
Hi Rohith,

Using execution(java..*.*(..)) won't get you the desired result. The ajc compiler need to have the java..* package under its control (i.e. being able to weave into) for this to work.

However, that does not explain the exceptions you are seeing. Can you post a minimal working example that shows the problem. Also try compiling at command-line using ajc to rule out any AJDT-related issues.

-Ramnivas
arrohith (4) [Avatar] Offline
#3
Re: Exceptions while running woven code
Hi Ramnivas,
Thanks a lot, i figured out that the AJDT plug-in compiles all the classes into a different path than intended and i ended up running an older version of the aspect, and that's y the exceptions.


Rohith.