tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: dynamic class loading problem in 4.1.24
Date Thu, 15 May 2003 12:07:49 GMT

So, you are saying A.jar is in common/lib and plugin.jar is in 
WEB-INF/lib?  In that case plugin.jar will be able to see A.jar, but not 
vice-versa.  This is because of Java2 ClassLoader rules.  Classloaders 
higher in the hierarchy can't see ClassLoaders lower in the 
hierarchy.   The only ways around this are using the lib/ext as you've 
done, putting both jars in the same classloader (recommended), or making 
sure that the A.jar uses the thread context classloader to be able to see 
classes in other classloaders.

Jake

At 12:48 PM 5/15/2003 +0100, you wrote:

>I am trying to upgrade from tomcat 4.0.6 to 4.1.24
>Suddenly I experience problem with a classloader behaviour.
>
>My web application uses a library A.jar and in runtime loads class from the
>file plugin.jar.
>With 4.0.x I put the file A.jar into common/lib directory and everything
>worked ok. Servlet class from A.jar was loaded at the beginning and then
>plugin.jar was dynamically loaded.
>
>With 4.1.24 the classes from A.jar are not visible when loading plugin.jar 
>( I
>am using JarClassLoader class) and I have to put A.jar into the central
>"jre/lib/ext" directory.
>
>This is somehow not acceptable, but I would really like to stick with 4.1.24.
>
>Any advice ?
>
>Thanks
>
>Matt
>
>--
>Matt Koss
>Knowledge Media Institute
>Open University
>tel: +44 1908 659399
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message