tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Ludwig <>
Subject Re: Tomcat 5.5.26 / 6.0.18 difference: loading jdbc jar??
Date Thu, 27 Nov 2008 01:12:23 GMT
Ken Bowen schrieb am 26.11.2008 um 19:21:33 (-0500):
>    Under 5.5.26, TC+myApp will load the mysql jar from either common/ 
> lib or webapps/myApp/WEB-INF/lib.
>    Under 6.0.18, TC+myApp will only load the mysql jar from tomcat's  
> lib.  If I try to move the mysql
>    jar from Tomcat's lib to webapps/myApp/WEB-INF/lib, I get the  
> following error when the first attempt
>    to access the db is made:
>         Cannot load JDBC driver class 'com.mysql.jdbc.Driver'

In order for JNDI data sources to work, both Tomcat and the web app must
have access to the driver. So you have to put the driver in Tomcat/lib;
putting it in WEB-INF/lib makes it private to the web app.

> A) is this a new feature in TC6? (if so is there doc anywhere?);
> or (more likely)

Class loading has changed:

> B) is there something I need to adjust in my configuration and jndi
> code?

If you want the JNDI data source, put the mysql.jar in Tomcat/lib.

Michael Ludwig

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message