Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] @missing@ exception while using LTW.

Title: Message
Thanks!
 
I've just figured this out by myself ... :)
 
-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron Bodkin
Sent: Monday, November 07, 2005 7:05 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] @missing@ exception while using LTW.

Hi Michael,

 

Did you compile the aspect or just put the source in that directory? With load-time weaving, you still need to compile your aspects into bytecode, but you don’t need to “weave” with the classes at build-time. Try compiling your aspect and putting the result in the same directory, e.g.,

 

cd WEB-INF\classes

ajc com\test\MyAspect.aj

 

(of course for production use, I’d recommend compiling with an ant task and deploying this class file with the rest of your application…) 10x 

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Michael Kantarovich
Sent: Monday, November 07, 2005 8:36 AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] @missing@ exception while using LTW.

 

Hi everybody!

I'm using aspectj M4 version and trying to enable load-time weaving for my application. The application is web application.

I have created aop.xml under WEB-INF/classes/META-INF.

Here is the file:

<aspectj>

        <aspects>

                <aspect name="com.test.MyAspect"/>

        </aspects>

        <weaver options="-XlazyTjp -showWeaveInfo">

                <include within="com.test.*"/>

        </weaver>

</aspectj>

I'm using weaving agent through the JVMTI.

The trouble is that weaver is unable to find MyAspect, although it's present in directory WEB-INF/classes/com/test.

If I understand correct, I just have to place .aj file in the classpath of my application, and to declare it in aop.xml … So what can be wrong?

Here is the stack trace:

warning Register definition failed -- (RuntimeException) Cannot register non aspect: @missing@ , com.test.MyAspect

Cannot register non aspect: @missing@ , com.test.MyAspect

java.lang.RuntimeException: Cannot register non aspect: @missing@ , com.test.MyAspect

        at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:174)

        at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(ClassLoaderWeavingAdaptor.java:278)

        at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions(ClassLoaderWeavingAdaptor.java:166)

        at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:114)

        at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:129)

        at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.java:134)

        at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:100)

        at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:65)

        at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52)

        at sun.instrument.TransformerManager.transform(TransformerManager.java:122)

        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)

        at sun.misc.Unsafe.defineClass(Native Method)

        at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)

        at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)

        at java.security.AccessController.doPrivileged(Native Method)

        at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)

        at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:76)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:30)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

        at java.lang.Class.newInstance0(Class.java:350)

        at java.lang.Class.newInstance(Class.java:303)

            ….

 

Thanks a lot!

Misha.


Back to the top