[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Load-time veaving not seeing aspect

Yes, the LTW agent does not attempt to compile the aspects being woven. It requires everything to be compiled already.

Dean

Kyle Lomeli wrote:
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 <kyllerss_009@xxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
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:

[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 <http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/> alerts you the instant new Mail arrives. Check it out. <http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolbar/features/mail/>


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


------------------------------------------------------------------------
Sucker-punch spam <http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html> with award-winning protection.
Try the free Yahoo! Mail Beta. <http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html>


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


------------------------------------------------------------------------
Any questions? Get answers on any topic at Yahoo! Answers <http://answers.yahoo.com/;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx>. Try it now.
------------------------------------------------------------------------


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


--
Dean Wampler, Ph.D.
dean at aspectprogramming.com
objectmentor.com <http://www.objectmentor.com>
aspectprogramming.com <http://www.aspectprogramming.com>
contract4j.org <http://www.contract4j.org>

I want my tombstone to say:
Unknown Application Error in Dean Wampler.exe.
Application Terminated.
Okay 	Cancel