tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Re: Tomcat 6 unstable
Date Tue, 25 Nov 2008 01:52:22 GMT
> From: Ariela Carrera [mailto:jabaliacuatico@yahoo.com.ar]
> Subject: Re: Re: Tomcat 6 unstable

> 3) About the db2 jdbc driver, well, it is allocated in many paths...
>
> JAVA_HOME/jdk/jre/lib/ext/db2jcc.jar
> CATALINA_HOME/lib/db2jcc.jar
> CATALINA_HOME/webapps/cqaex/db2jcc.jar
> CATALINA_HOME/webapps/peerca/WEB-INF/lib/db2jcc.jar
> DB2_HOME/V9.5/java/db2jcc.jar

This is not good.  You must not place a jar in multiple locations that are visible along any
single branch of the classloader hierarchy.  Look at the diagram and discussion here:
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

      Bootstrap
          |
       System
          |
       Common
       /     \
  Webapp1   Webapp2 ...

Since the jre/lib/ext directory is essentially part of the Bootstrap class loader, you now
have three locations that the DB2 JDBC driver might be loaded from.  This pretty much guarantees
class loading conflicts that will result in all sorts of problems, including NoClassDefFoundError,
and many other more subtle issues.

To use Tomcat's DB connection pooling, the jar needs to be in either the jre/lib/ext or the
CATALINA_HOME/lib location - not both.  It cannot be in WEB-INF/lib to use Tomcat's connection
pooling, but it can be there if you use your own pooling (or no pooling at all), in which
case it must be removed from the other two places.

The webapps/cqaex and DB2_HOME locations will be ignored by Tomcat, but as Michael L pointed
out, the former location exposes the jar to remote clients, which is bad practice.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

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


Mime
View raw message