After more poking around (I hope this helps someone some day), I have found
that either my understanding of how LTW works is way off... or I missed key
instructions somewhere along the line.
I found that if I place the .class file that is generated from the .aj file in
the classpath (I obtained this .class file from having enabled the Eclipse
AspectJ on the project and then disabling it), LTW works as expected. However,
if the .aj file is used instead, the whole process breaks down.
Is there something I am missing? Does LTW depend on having the .class file
present for LTW?
-Kyle
----- Original Message ----
From: Kyle Lomeli <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, January 30, 2007 11:08:34 PM
Subject: Re: [aspectj-users] Load-time veaving not seeing aspect
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:
[EMAIL PROTECTED] info AspectJ Weaver Version 1.5.3 built on Wednesday Nov 22,
2006 at 11:18:15 GMT
[EMAIL PROTECTED] info register classloader [EMAIL PROTECTED]
[EMAIL PROTECTED] info using configuration <my home
path>/AspectJ%20Bug/src/META-INF/aop.xml
[EMAIL PROTECTED] 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 <[EMAIL PROTECTED]>
To: [email protected]
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:
[EMAIL PROTECTED] info AspectJ Weaver Version 1.5.3 built on Wednesday Nov 22,
2006 at 11:18:15 GMT
[EMAIL PROTECTED] info register classloader [EMAIL PROTECTED]
[EMAIL PROTECTED] info using configuration
/C:/Test/target/classes/META-INF/aop.xml
[EMAIL PROTECTED] info no aspects registered. Disabling weaver for class loader
[EMAIL PROTECTED]
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._______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta._______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users
____________________________________________________________________________________
Never Miss an Email
Stay connected with Yahoo! Mail on your mobile. Get started!
http://mobile.yahoo.com/services?promote=mail_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users