Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] LTW with dependencies on the webapp jars

Hi Alec,

 

You should put your aop.xml file in webapps/test/WEB-INF/classes/META-INF. The classes directory is on the classpath.

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Alec Lebedev
Sent: Friday, October 27, 2006 9:10 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] LTW with dependencies on the webapp jars

 

I haven’t received any feedback on the question I posted yesterday, so I’ll post my findings.

 

In order to defer aspect weaving until the web app gets loaded, I tried putting aop.xml in webapps/test/META-INF folder. However, it doesn’t get picked up by the load-time weaver.

If I move aop.xml back to common/classes/META-INF, then when I start Tomcat I get errors about missing log4j classes because my aspects use log4j for logging.

If I add log4j.jar to common/lib, then when I start Tomcat I get errors about the Test webapp classes imported from the aspect missing.

 

After all these experiments, LTW behavior does make sense. So, I can see only two solutions for my problem:

  1. Find a way to defer loading aspects until Tomcat loads the webapp.
  2. Remove any external dependencies from my aspect and define them through abstract pointcuts and aop.xml

 

I think 2 – is the way to go.

 

Is it possible to do 1?

What other options do I have?

 

Thanks.

 

Alec

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Alec Lebedev
Sent: Thursday, October 26, 2006 12:39 PM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] LTW with dependencies on the webapp jars

 

Hi,

 

I am using Tomcat 5.5 to deploy my web application Test.

I also have an aop.xml file, which weaves aspects located in a separate aspects.jar into Test web application classes.

Aspects in aspects.jar were compiled against classes and jars from Test, but those classes and jars are not included in aspects.jar. Therefore, aspects from aspect.jar should be loaded within the context of Test webapp in order to have access to its classes in WEB-INF/classes and jars in WEB-INF/lib.

 

So, my question is how to configure LTW in Tomcat environment so that aop.xml has access to aspects from aspects.jar and aspects from aspects.jar have access to the Test webapp classes and libraries?

 

Thanks.

 

Alec

 


Back to the top