I just checked the docs and the order in which classloaders are searched hasn't changed from 5.5 -> 6.0. Still have to be careful a specific class is only found once in the classloader tree from the perspective of the webapp.

--David

Gregor Schneider wrote:

I see, so things quite changed from 5 to 6, however:

When it comes to a Tomcat 5.x, it still goes that you put your jar
(i.e. a jdbc-driver)

EITHER

in $CATALINA_HOME/lib (when used from Tomcat AND other webapps)

OR

in $CATALINA_HOME/webapps/yourwebapp/WEB-INF/lib (when used by a
specific web-app only)

When reading http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html,
one thing jumped into my eyes:

<quote>
When a request to load a class from the web application's WebappX
class loader is processed, this class loader will look in the local
repositories first, instead of delegating before looking.
</quote>

That's the big difference, before the classloader was delegating, and
then you could run into problems, i.e. there was a jdbc-driver both in
common/lib, one in WEB-INF/lib, and both having different versions -
the one from common/lib always got loaded, so that problem seems to be
fixed now.

However, with the new classloading-model in Tomcat 6 and the comments
from the docs above, it shouldn't matter whether you have them both in
$CATALINA_HOME/lib and webapps/your_app/WEB-INF/lib since the one from
your webapp gets loaded anyways, right?

Cheers

Gregor


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to