tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LAMY Olivier <>
Subject Re: java.sql.SQLException: Cannot load JDBC driver class 'null'
Date Thu, 05 Dec 2002 09:14:10 GMT
Normally it's

InitialContext initContext=new InitialContext();
DataSource ds = (DataSource) envCtx.lookup("java:/comp/env/jdbc/art");

I have the same problem. I tried to move my ressources declaration from the
context to the <GlobalNamingResources>.
And it doesn't work ???

----- Original Message -----
From: "Roberts, Eric" <>
To: "Tomcat Users List" <>
Sent: Thursday, December 05, 2002 9:45 AM
Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null'


How are you instantiating your datasource?

You need something like:

import javax.naming.Context;
import javax.naming.InitialContext;
   ctx = new InitialContext();
   Context envCtx = (Context) ctx.lookup("java:/comp/env/");
   DataSource ds = (DataSource) envCtx.lookup("/jdbc/art");

Hope this helps.

-----Original Message-----
From: Roberto Bouza []
Sent: Mittwoch, 04. Dezember 2002 23:05
Subject: java.sql.SQLException: Cannot load JDBC driver class 'null'


 I think I have all the configuration fine, but for some reason when my
try to get the connection from the DB I only get this:

 ----------------------------- ERRORS start ------------------------

java.sql.SQLException: Cannot load JDBC driver class 'null'
        at poseidon.ext.DBTest.init(

------------------------------ ERRORS end -------------------------

 What's done:

 1.) In the $CATALINA_HOME/common/lib I have postgresql.jar (PostgreSQL
commons-collections.jar, commons-pool.jar, commons-dbcp.jar
 2.) My server.xml:

        --------------- SERVER XML starts ------------------------

       <Resource name="jdbc/art" auth="Container"

  <ResourceParams name="jdbc/art">











          ----------------------- SERVER.XML end --------------------------

         All that code inside a context tag.

      3.) My web.xml

         ----------------- STARTS ---------------
        <description>postgreSQL Art's Datasource</description>
       --------------------- END -------------------

    5.) I'm using Tomcat 4.1.16 with Apache 2.0, Plus PostgreSQL 7.3 and jdk

    Tomcat starts fine, all works fine but when my DBTest is triying to get
connection I get the error mentioned before. I really don't know why tomcat
not seeing the Driver if it is on common/lib...???????????

    Thanks in advance for your help.
=             Roberto Bouza Fraga               =
      Research & Development Engineer
       Ella Cisneros Fontanals Holdings
 Ph: (305)-860-0116 / Fax:(305)-860-9401

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

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

Ce message électronique et tous les fichiers joints ainsi que  les
informations contenues dans ce message (ci après "le message"), sont
confidentiels et destinés exclusivement à l'usage de la  personne à laquelle
ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le
renvoyer à son émetteur et de le détruire. Toute diffusion, publication,
totale ou partielle ou divulgation sous quelque forme que ce soit non
expressément autorisées de ce message, sont interdites.  
This e-mail, any attachments and the information contained (herein " the
message") are confidential and intended solely for the use of the
addressee(s) if you have received this message in error please send it back
to the sender and delete it. Unauthorized publication, use, dissemination or
disclosure, either whole or partial, of this  message is strictly

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

View raw message