Hi Andy, thank you very much for your response. I had first tried posting to
the Spring AOP forum, here:
http://forum.springsource.org/showthread.php?t=93274

After receiving no replies I thought perhaps asking on this list would be
more fruitful. I have since found it easier to add compile-time weaving via
Maven than to continue trying to debug the load-time weaving. I will attempt
to revisit this at some point based on your feedback below, as it sounds
like a fix may be able to get around this by packaging my aspects into their
own jar, with their own aop.xml, so that they are picked up by the modified
classloader.

For the record, I have tried running this using both the application context
configuration, and also passing
JAVA_OPTS=-javaagent:$CATALINA_HOME/lib/aspectjweaver.jar to Tomcat through
modification of the catalina.sh script.

Thanks again,
Will

On Fri, Aug 6, 2010 at 3:57 PM, Andy Clement <[email protected]>wrote:

> Hi William,
>
> The weaver looks on the classpath of the classloader it is attached to
> in order to find aop.xmls.  Here it looks like
> TomcatInstrumentableClassLoader can find the one in spring aspects.
> However, isn't your app being loaded by a different (sub?)classloader
> - are you running with -javaagent to achieve ltw here? or just relying
> on the application context configuration?
>
> You will probably find more users running in this configuration on the
> Spring AOP forum:
> http://forum.springsource.org/forumdisplay.php?f=31
> you might want to ask there.
>
> cheers,
> Andy
>
> On 5 August 2010 06:40, William Briggs <[email protected]> wrote:
> > I have a Spring-based webapp with which I have been successfully using
> > Spring AOP to perform logging at specific pointcuts. I now have to
> perform
> > some logging and profiling on objects and methods which are not managed
> by
> > Spring; in order to do so, I decided to change from Spring AOP to AspectJ
> > LTW. My Spring aspect is already annotated in using @Aspect, @Pointcut
> and
> > @Around/@Before annotations, so I thought it would be a relatively
> > straightforward process.
> >
> > After monkeying with the webapp classloader, I have successfully managed
> to
> > get the classloader to find Spring aspect; at least I believe I have,
> based
> > on this logging output:
> > [tomcatinstrumentableclassloa...@13b3d473] info AspectJ Weaver Version
> 1.6.9
> > built on Monday Jul 5, 2010 at 15:28:35 GMT
> > [tomcatinstrumentableclassloa...@13b3d473] info register classloader
> >
> org.springframework.instrument.classloading.tomcat.tomcatinstrumentableclassloa...@13b3d473
> > [tomcatinstrumentableclassloa...@13b3d473] info using configuration
> >
> file:/usr/local/apache-tomcat-6.0.26/webapps/<mywebapp>/WEB-INF/lib/spring-aspects-3.0.2.RELEASE.jar!/META-INF/aop.xml
> > [tomcatinstrumentableclassloa...@13b3d473] info register aspect
> > org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
> > [tomcatinstrumentableclassloa...@13b3d473] info register aspect
> > org.springframework.transaction.aspectj.AnnotationTransactionAspect
> >
> > However, as can be seen in the output, it is still not picking up my
> aop.xml
> > located in my web app at META-INF/aop.xml. I am open to suggestions on
> > additional avenues I can take to debug this problem.
> >
> > Thanks,
> > Will
> >
> > _______________________________________________
> > aspectj-users mailing list
> > [email protected]
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to