Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ajdt-dev] Problem when weaving aspects boxed in a jar file

Hi everyone,

I'm encountering the following exception when I'm trying to use
AspectJ aspects 
contained in a jar:

BCException thrown: malformed org.aspectj.weaver.PointcutDeclaration
attribute 
java.io.EOFException

I'll explain the problem with a simple 2 projects example.
In the first eclipse project I write a Trace.aj aspect (very simple
around advice 
code).

public aspect Trace {
    pointcut toBeTraced():
        execution( void *.*());
   
    void around():toBeTraced(){
        System.out.println("before method call
"+thisJoinPoint.getSignature());
        proceed();
        System.out.println("after method call
"+thisJoinPoint.getSignature());
    }
}

I compile this aspect with the reweavable option, and I make a jar
with this file: 
trace.jar
Then, I have a second eclipse project with a Test.java class such as
the following 
one:

public class MyClass {
   
    public void run() {
        System.out.println(this.getClass().getName()+".run() :-)");
    }   
    public static void main(String[] args) {
        new MyClass().run();
    }
}

Then, I set the "AspectJ Aspect Path" with the trace.aj file (on the
2nd project 
properties), and the exception is thrown.

Note that I do not have this problem if I'm using Eclipse 3.0 with the
first version of 
the ajdt plugin.
The problem arises when I'm using Eclipse 3.0 or Eclipse 3.1 with the
ajdt plugin 
version >1.2.

The problem is not an AspectJ problem because if I'm doing the same
procedure 
with an ant file, the weaving is working well.

any idea? maybe a bug in ajdt? I'm not sure.

Regards,
Nicolas



Back to the top