tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Why tomcat 6.0.18 looks for MySQL JDBC driver to be placed in CATALINA_HOME/lib folder?
Date Thu, 05 Feb 2009 22:42:24 GMT
Hash: SHA1


peterramesh wrote:
> On reading Tomcat help doc 
>, it
> recommends to place the MySQL  JDBC driver in both places (CATALINA_HOME/lib
> and WEB-INF/lib folder of the app).

I don't think so. The only place on that page where WEB-INF/lib is
referenced is here (as "application's lib folder"):

Note: placing these jars in both $CATALINA_HOME/lib and a web
application's lib folder will cause an error, so ensure you have them in
the $CATALINA_HOME/lib location only.

Putting your JDBC driver in both place is a recipe for pain.

> 1. Why Tomcat look for the JDBC jar to be in CATALINA_HOME/lib folder?

Tomcat creates the JNDI DataSource and loads your driver outside of the
webapp's ClassLoader. I'm not sure why it does this, but it does. That
requires you to make your driver available to Tomcat in CATALINA_HOME/lib.

> 2. If I copied more than one JDBC jars (with different version) in
> CATALINA_HOME/lib folder for couple of my applications, how each of them
> looks for the respective versions of JDBC driver?

They can't. It'll be completely random which version of the driver
"wins". If you /need/ different JDBC driver versions for the same
database, then you are better off with separate Tomcat instances.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message