Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] NoAspectBoundException

Hi all!

I have a problem executing my woven jar file.

Example:
Guess we have an aspect (A.aj) a jar (lib.jar) that contains only one
package p with one class p.C.class.
The aspect provides an execution pointcut used to advice before a method
execution in C.
The woven output wovenLib.jar now contains one package p and within 
p one class (the altered) p.C.class and one Class representing the aspect
p.A.class.

No I execute the wovenLib.jar.

The Exception I get is java.lang.NoClassDefFoundError 
caused by NoAspectBoundException.

The API says:
NoAspectBoundException
Thrown by the aspectOf special method on aspect types when there is no
aspect of that type currently bound.

By default aspect instances are singletons accessed through the aspectOf
static method. So while the class C is trying to access the singleton
instance of A via the aspectOf method the Class could not be found.

Why is that? The A.class resides in the same package as C.class. The scope
is quite small. =)

Do I have to take care of some ajc options while I'm doing post-compile time
weaving? Currently I'm using the default ajc options within Eclipse AJDT.

The next step I want to do is weave my aspect and object libs during
load-time. But I guess that the problem would not become smaller.

Thanks for advice.=)

CptNuss

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie


Back to the top