geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Becker <dan.o.bec...@gmail.com>
Subject Re: Use of AspectJ load time weaving in Geronimo
Date Mon, 13 Jul 2009 21:43:01 GMT
Ahh, true Kevan, I am omitting one other step that I normally do to make 
this run on Apache Tomcat. Namely, this context.xml is placed in the web 
app META-INF/context.xml, and the Spring JAR spring-tomcat-weaver.jar is 
placed into $CATALINA_HOME/server/lib:

<Context path="/MyApp" reloadable="false">
     <Loader 
loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
</Context>

I've had success now in Geronimo with instrumenting the the system class 
loader by setting JAVA_OPTS==-javaagent:%ASPECTJ_WEAVER% (where 
ASPECTJ_WEAVER points to aspectjweaver-1.6.2.jar) before I call 
geronimo.bat, but I would rather run the weaver as part of the web app 
class loader rather than the system class loader. So is it possible to 
do an instrumented web app class classloader using context.xml or some 
other mechanism in Geronimo?

Kevan Miller wrote:
> On Jul 13, 2009, at 11:26 AM, Dan Becker wrote:
> 
>> I've been implementing an Aspect Oriented Programming (AOP) profiling 
>> and timing system on some of my web application code. I've been able 
>> to Load Time Weave (LTW) my application code using plain Apache Tomcat 
>> by placing the following AOP configuration file in 
>> WEB-INF/classes/META-INF/aop.xml:
>> ... 
>>
>> However, when I try the same operation in Geronimo 1.1.1 (J2EE version 
>> with Tomcat), I do not see the weaver weaving, nor do I catch any of 
>> the application code with the pointcuts or the aspects.
> 
> I assume you're using G 1.1.1 for a reason. Have you tried 2.1.4?
> 
> You must be doing more than simply creating an aop.xml file. Otherwise, 
> how is AspectJ getting loaded/triggered to read the configuration file?
> 
>>
>> Have other people tried AOP with Geronimo? Have they been successful 
>> load time weaving with such a configuration file? Pointers to any AOP 
>> examples with Geronimo are appreciated.
> 
> Maybe others who have used it. I've never tried it. But interested to 
> see it running. Even more interested to see it on G 2.1.4 :-P, but happy 
> to help with 1.1.1, also...
> 
> Prolly best to follow up on our user@ list...
> 


-- 
Thanks, Dan

Mime
View raw message