Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ for non Spring beans

After making aop.xml available to classloader by copying it into WEB-INF/classes/META-INF it is picked up. However, none of the classes are picked up for weaving. Getting "[TomcatInstrumentableClassLoader@17918d9b] debug not weaving" messages printed for almost all spring, hibernate and my local classes. I guess I am one more step closer but not quite there yet. Any clues?

On 8/26/15 3:31 AM, Rallavagu wrote:
After further investigation, it appears that aspectj is picking up the "aop.xml" from spring-aspects.jar instead of META-INF/aop.xml. Trying to figure how to make it look into META-INF/aop.xml instead.

On 8/25/15 10:03 AM, Rallavagu wrote:
Thanks for the response. I have reconfigured the app to use aspectj instead of spring aop. Running on tomcat 7 and still does not seem to work. The previous aspects also stopped working. I guess there is some configuration or something is missing but can't figure out. I have done the following.

1. Removed <aop:aspectj-autoproxy/> and added
<context:load-time-weaver aspectj-weaving="on"

weaver-class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver" /> instead

2. Added aop.xml to META-INF directory
3. Added following to META-INF/context.xml for the app

<Context path="/app" docBase="">
    <Loader

loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
</Context>

Application starts fine, but does not seem to engage. Any clues? Thanks.


On 8/25/15 6:41 AM, Alexander Kriegisch wrote:
Please read Spring manual, chapter 10.8, in order to learn how to use full AspectJ via load-time weaving from within Spring. LTW works for non-Spring classes as well because it does not rely on dynamic proxies as simple Spring AOP does.



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users





Back to the top