Hi!

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"
         reloadable="false"
         loaderClass="my.own.ClassLoader" />
</Context>
(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,

Volker.


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

  • ... Volker Leidl
    • ... Дмитрий Верещагин

Reply via email to