Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] LoadTime Weaving with aj.bat

Hi folks!

I wrote an aspectLib.jar and want to wove the aspects to a whatever.jar
during loadtime. Everytime my application myApp.jar runs the whatever.jar is
being loaded into the VM and so the AspectLib should be woven during
loadtime. 

I took the aj.bat script as an example and call something like this:
~~~~~~~~~~~~~~~~~snip
java 
-classpath $AspectJ_LIB/aspectjweaver.jar
-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader
-Daj.class.path=aspectLib.jar;whatever.jar 
-Daj.aspect.path=aspectLib.jar 
-jar myApp.jar
~~~~~~~~~~~~~~~~snap

No I get a ClassNotFoundException
org.aspectj.weaver.loadtime.WeavingURLClassLoader

(A simple: java -jar myApp.jar works fine.)

If I don't use the "-jar myApp.jar" option but call the Main class it also
works fine:
~~~~~~~~~~~~~~~~~snip
java 
-classpath $AspectJ_LIB/aspectjweaver.jar;myApp.jar
-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader
-Daj.class.path=aspectLib.jar;whatever.jar
-Daj.aspect.path=aspectLib.jar
foo.bar.MyAppMain
~~~~~~~~~~~~~~~~~snap

Why is that????

I'm using jre 1.5.0_05 but I don't want to use the -javaagent option.

Cheers,

CptNuss

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


Back to the top