tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volker Leidl" <>
Subject Custom ClassLoader
Date Thu, 04 Apr 2002 14:58:19 GMT

I'm trying to implement my own web app classloader (Tomcat 4.0.2).

By default an instance of org.apache.catalina.loader.WebAppLoader is used
which references an org.apache.catalina.loader.WebAppClassLoader object
which represents the actual classloader. These two defaults can be replaced
by editing server.xml.
Following the documentation I nested the a Loader tag inside my context:
<Context ...>
 <Loader delegate="false"
         loaderClass="my.own.ClassLoader" />
(I could as well replace WebAppLoader by specifying a className attribute in
the Loader tag.)

If I understood the code correctly this should make the WebAppLoader use
my.own.ClassLoader as loader for the web app.
Unfortunately this does not work. Looking at the implementation of
WebAppLoader I found out that an instance of class WebAppClassLoader is
explicitly created in method start():

 if (parentClassLoader == null) {
     classLoader = new WebappClassLoader(container.getResources());
 } else {
     classLoader = new WebappClassLoader
                   (parentClassLoader, container.getResources());

The value of property loaderClass is obviously ignored.
It seems that this feature has been considered in some parts of the code,
although being not yet available.

Did I get something wrong in the docs or in the code?
Is there someone who managed to run a web app with a custom classloader?

Best regards,


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message