Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] LTW on tomcat 5.5.12, the server stuck

Hi Guofeng,

I'm assuming you have configured your aspects correctly using the
META-INF/aop.xml description file. The symptom you are describing sounds
like you haven't. Could you post an example of your META-INF/aop.xml file?
Alternatively, do you have both compile-time and load-time weaving?

The LTW system is classloader aware: aspects will only apply to classes
loaded by their classloader or another classloader that sees their
definition (typically a parent classloader). So if you install aspects and
their META-INF/aop.xml definition file in Tomcat's common folder (either
exploded into common/classes or a jar in common/lib), they will apply to
almost all of Tomcat (except bootstrap code), and all Web applications in
the system. If you install to shared, they will apply to all apps but not
the container. If you install to WEB-INF, they will apply to a single
application. Putting your aspects and their definition into the system
classpath will affect everything but the Java bootstrap and ext
classloaders.

In general, there is more memory and startup time overhead in weaving into
more code, so if you have an application-specific set of aspects, I'd deploy
them just into WEB-INF/lib (this would still allow you to affect application
libraries).




-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Guofeng Zhang
Sent: Sunday, October 30, 2005 10:23 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] LTW on tomcat 5.5.12, the server stuck


If I put the aspects in shared/lib, it does not work. If I put the
aspects in WEB-INF/lib, it works. But it seems that the aspect is only
invoked when my servlet is being initialized. If I access the servlet by
the browser, it seems that the aspect is not invoked.

What the relationship between the LTW and the classloader? If I only
weave into my classes in the web application, should I put the aspects
in the classpath for the system classloader?

Thanks

Guofeng

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron Bodkin
Sent: Monday, October 31, 2005 1:34 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] LTW on tomcat 5.5.12, the server stuck

Hi Guofeng,

I can tell you that I've been able to deploy multiple different apps
with
load-time weaving using Tomcat 5.5.9 on both the Sun and BEA JRockIt
JVM's.
Do you have anything in your logs? Can you turn on weaving information
in
your aop.xml file? Do you need to weave into the system? You might try
just
putting your aspects in shared/lib or even WEB-INF/lib to see how it
behaves
then.

Also, have you tried deploying a very simple test case like a basic
tracing
aspect:

public aspect TestLtw {
    before() : staticinitialization(com.foo.myco..*) && !within(TestLtw)
{
        System.err.println("Initializing at "+thisJoinPointStaticPart);
    }
}


-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Guofeng Zhang
Sent: Sunday, October 30, 2005 8:29 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] LTW on tomcat 5.5.12, the server stuck

I download aspectj-DEVELOPMENT-20051029200407.jar.

Now the tomcat server starts up completely. But my web application is
not initialized. When access it, I got a 404 error that says that my
servlet is not available.

Thanks


-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Alexandre
Vasseur
Sent: Friday, October 28, 2005 10:51 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] LTW on tomcat 5.5.12, the server stuck

LTW with AJ 1.5.0 M4 has a know bug that leads to a deadlock with
Tomcat.
Can you try a development build ?
Alex

On 10/28/05, Guofeng Zhang <guofeng@xxxxxxxxxxxxx> wrote:
>
>
>
> I use LTW on Tomcat. The Tomcat server can not startup successfully. I
want
> to know if anyone have used LTW on Tomcat or any special configuration
is
> required?
>
>
>
> The following is the details.
>
>
>
> A simple aspect used to trace the entry and exit of the method
invocation
> (use System.out to output). I use a simple Java class to test it by
LTW, it
> works.
>
>
>
> I configure it on Tomcat 5.5.12, run on JDK 5.0. But the tomcat can
not
> start up completely.
>
>
>
> The following is the output when no LTW used:
>
> Oct 28, 2005 7:10:13 PM
> org.apache.coyote.http11.Http11BaseProtocol start
>
> INFO: Starting Coyote HTTP/1.1 on http-8080
>
> Oct 28, 2005 7:10:14 PM org.apache.jk.common.ChannelSocket
> init
>
> INFO: JK: ajp13 listening on /0.0.0.0:8009
>
> Oct 28, 2005 7:10:14 PM org.apache.jk.server.JkMain start
>
> INFO: Jk running ID=0 time=0/60  config=null
>
> Oct 28, 2005 7:10:14 PM
> org.apache.catalina.storeconfig.StoreLoader load
>
> INFO: Find registry server-registry.xml at classpath resource
>
> Oct 28, 2005 7:10:14 PM
> org.apache.catalina.startup.Catalina start
>
> INFO: Server startup in 8192 ms
>
>
>
> When use LTW, the output stopped at the second line, that is
>
> INFO: Starting Coyote HTTP/1.1 on http-8080
>
>
>
> I remove my web application completely from the tomcat, and restart
tomcat
> using the same script as the above (keep using LTW), I got the same
result,
> i.e., tomcat stopped at the second line.
>
>
>
> I use apsectj M4.
>
>
>
> Thanks
>
>
>
> Guofeng
>
>
>
> AOP.xml:
>
> <aspectj>
>
>
>
>             <aspects>
>
>               <aspect name="com.gf.tracing.TracingAspect"/>
>
>             </aspects>
>
>
>
>             <weaver options="-1.5 -warn:none">
>
>               <include within="com.mycompany..*"/>
>
>             </weaver>
>
> </aspectj>
>
>
>
> ASPECT
>
> package com.gf.tracing;
>
>
>
> public aspect TracingAspect {
>
>
>
>          pointcut points():
>
>                !within(TracingAspect) && !within(TraceSupport) && call
( *
> com. mycompany..*(..) ) ;
>
>
>
>            before(): points() {
>
>                      System.out.println(
thisJoinPoint.getSourceLocation() +
> " " + thisJoinPoint.toShortString() ) ;
>
>            }
>
>            after(): points() {
>
>              System.out.println( thisJoinPoint.getSourceLocation() + "
" +
> thisJoinPoint.toShortString() ) ;
>
>            }
>
> }
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top