Hi all,
I’m new to aspectj. Please help me with the following,
Project details,
We a java swing based application (with proper installer and
everything).
Now I want to add some aspects to this code and use load
time weaving to impart additional behaviour.
I’m currently doing a proof of concept to achieve the
same.
These are the steps I followed,
1) I’m
using aspectj-1.5.0M3.jar
2) The run
script had the following entry for class path variable,
WORKBENCHPATH = plugins/InFluxDifferencer.jar;.;patch/WorkbenchPatch.jar;InFluxTools.jar;jdom.jar;ocl-argo.jar;nsuml.jar;xerces.jar;xml4j.jar;TableLayout.jar;itext-0.96.jar;itext-xml-0.96.jar;kawa-1.7.jar;servlet-api.jar;velocity-1.4.jar;velocity-dep-1.4.jar;
Modified entry
reads,
WORKBENCHPATH =
META-INF\aop.xml;aspectjrt.jar;aspectjweaver.jar;aspects.jar;
plugins/InFluxDifferencer.jar;.;patch/WorkbenchPatch.jar;InFluxTools.jar;jdom.jar;ocl-argo.jar;nsuml.jar;xerces.jar;xml4j.jar;TableLayout.jar;itext-0.96.jar;itext-xml-0.96.jar;kawa-1.7.jar;servlet-api.jar;velocity-1.4.jar;velocity-dep-1.4.jar;
I
have added/included the following in the class path,
Some aspects
(bundled into aspects.jar)
aop.xml
and aspect runtime
and weaver jars
3) My java run
script originally read like this,
java -Djava.ext.dirs=./plugins/resources
-Xms32m -Xmx256m -Xss600k -classpath %WORKBENCHPATH%
multiuser.client.ui.FrameLogin
I have modified this to invoke agent as follows,
java -Daj.weaving.verbose=true
-Djavaagent:aspectjweaver.jar -Djava.ext.dirs=./plugins/resources
-Xms32m -Xmx256m -Xss600k -classpath %WORKBENCHPATH%
multiuser.client.ui.FrameLogin
When
I run the code, the aspects don’t get reflected. (not weaved). I do not
get the verbose messages for weaving also…
There
seems to be something wrong here..
Please help.
What
else do I need to do to enable load time weaving of aspects?
Note:
I’m
using JRE 1.5 to run the code..
Seshu Kumar Adiraju
Technical Architect
SETLabs
Infosys Technologies Limited