tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Bowen <>
Subject Tomcat 5.5.26 / 6.0.18 difference: loading jdbc jar??
Date Thu, 27 Nov 2008 00:21:33 GMT
Hi all,

Using: tomcat-6.0.18 (download from Apache), simply unzipped & running
        java 1.5.0_16 on a Mac OS X 10.5.5

I've just switched up from 5.5.26 to 6.0.18 (both downloads from  
I seem to have one datasource difference: Using the same  
configurations and code:

    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'

I scanned the Tomcat 6 changelog, but nothing about this caught my eye  
-- but my eyes are not that good anymore :-).

A) is this a new feature in TC6? (if so is there doc anywhere?);
or (more likely)
B) is there something I need to adjust in my configuration and jndi  
In case of the latter, I've attached my context.xml (from myApp/META- 
INF) and my jndi code at the end.

Have a Happy Thanksgiving (wherever it is celebrated)
Thanks much in advance,
Ken Bowen

<Context path="" debug="5" reloadable="true" crossContext="true">

   <Resource name="jdbc/securities_info" auth="Container"  
             maxActive="100" maxIdle="30" maxWait="10000"
             username="XXX" password="XXX"
             validationQuery="select 1"


Datasource setup (runs in contextInitialized in ServletContextListener):

         Context initialContext = new InitialContext();
         if (initialContext == null ) {
                 throw new Exception("Boom - No Initial Context");
         Context envCtx = (Context) initialContext.lookup("java:comp/ 

         String key = "jdbc" + "/" + SECURITIES_INFO;
         DataSource ds = (DataSource)envCtx.lookup(key);
         if (ds != null ){
             MD_DAOs2.set_siDAOBase(new SI_DAOBase());

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

View raw message