After a bit more prodding around, I realized that I had forgotten to include the aspect definition: <aspect name=.../> entry. Now that I have defined the aspect within the aop.xml file, I am getting the following error:
[AppClassLoader@18e3e60] info AspectJ Weaver Version 1.5.3 built on Wednesday Nov 22, 2006 at 11:18:15 GMT
[AppClassLoader@18e3e60] info register classloader sun.misc.Launcher$AppClassLoader@18e3e60
[AppClassLoader@18e3e60] info using configuration <my home path>/AspectJ%20Bug/src/META-INF/aop.xml
[AppClassLoader@18e3e60] info register aspect test.aop.MethodAnnotationAspect
Jan 30, 2007 11:05:37 PM org.aspectj.weaver.tools.Jdk14Trace error
SEVERE: register definition
failed
java.lang.RuntimeException: Cannot register non aspect: test$aop$MethodAnnotationAspect , test.aop.MethodAnnotationAspect
at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:205)
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(ClassLoaderWeavingAdaptor.java:399)
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions(ClassLoaderWeavingAdaptor.java:240)
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:152)
at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:151)
at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.java:156)
at
org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:122)
at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:73)
at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:55)
I have checked that the .aj file is in the classpath. Anyone have any suggestions?
Thanks!
----- Original Message ----
From: Kyle Lomeli <kyllerss_009@xxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Sent: Tuesday, January 30, 2007 6:35:34 PM
Subject: [aspectj-users] Load-time veaving not seeing aspect
I have been running into problems getting load-time weaving to work. I have set up a unit test to run with a JVM argument that will enable load-time weaving
(-javaagent:<path>\aspectjweaver.jar).Whenever I run my unit test from Eclipse, I see the following verbose output:
[AppClassLoader@9fbe93] info AspectJ Weaver Version 1.5.3 built on Wednesday Nov 22, 2006 at 11:18:15 GMT
[AppClassLoader@9fbe93] info register classloader sun.misc.Launcher$AppClassLoader@9fbe93
[AppClassLoader@9fbe93] info using configuration /C:/Test/target/classes/META-INF/aop.xml
[AppClassLoader@9fbe93] info no aspects registered. Disabling weaver for class loader sun.misc.Launcher$AppClassLoader@9fbe93
My aop.xml file is as follows:
http://www.eclipse.org/aspectj/dtd/aspectj.dtd"><aspectj>
<weaver options="-showWeaveInfo -verbose">
<include within="com.intralinks.core.organization..*"/>
</weaver>
<aspects>
<include within="com.intralinks.core.organization.aop.MyAspect"/>
</aspects>
</aspectj>
Here are my questions:
1) Is com.intralinks.core.organization.aop.MyAspect supposed to be a .aj file or is it supposed to be a .class file?
2) Is there anything else I can enable on my end to get better diagnostics information?
3) My assumption is that I could add the aop.xml file to the META-INF directory in my classpath, provide the JVM startup parameter and that would be all I would need. However, this
doesn't seem to be the case. Did I miss a step?
4) Has anyone experienced problems getting load-time weaving to work in Eclipse when running unit tests?
Any help will be much appreciated.
-Kyle
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
Check it out.