tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neo anderson <>
Subject Class loading question (with aspectj)
Date Fri, 04 Sep 2009 05:45:50 GMT

I read the document at and have a
question. What is the class loading order if the classes are located under
/WEB-INF/classes/ and /WEB-INF/lib/ respectively? 

I have a aspectj class (.aj) located under  /WEB-INF/classes/ and a Filter
(TapestryFilter) class located under /WEB-INF/lib/. Will the TapestryFilter
get loaded first and ignore aspectj class?

My scenario is :

My web application configure in
the web.xml to filter incoming request. Then an aspectj class will intercept
the execution of TapestryFilter.doFilter() method. The aspectj class looks
as below

pointcut intercept(): execution(*;

void around() : intercept(){
    System.out.println(".... test ...");
    logger.debug("..."); // slf4j log configured correctly

So what I expect is, for instance, when a user access from the browser the
log/console will print the log message. This scenario works fine when I copy
and rename (also change web.xml to use that new filter) TapestryFilter to
WEB-INF/class folder. However, if I use the default TapestryFilter (packaged
as jar file under WEB-INF/lib), the aspectj message won't be shown in the
log. Looks like the aspectj class is completely ignored. 

Is there any document/resource that tells more detail on how class loader
would work if classes  are located under WEB-INF/class and WEB-INF/lib? Or
any place of the source code would be a good start point to look at?

I appreciate any suggestion.

Thank you very much.


View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message