File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Cannot load JDBC driver class 'null'  ... WTF? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Cannot load JDBC driver class Watch "Cannot load JDBC driver class New topic
Author

Cannot load JDBC driver class 'null' ... WTF?

Ivan Jouikov
Ranch Hand

Joined: Jul 22, 2003
Posts: 269
Hi!
I been developing an app on my machine using com.mysql.jdbc.Driver .... Everything seems fine -- when I deploy it on my machine and test it everything works just perfectly...
However when I uploaded it to the server, I began to get the following exception:
"Cannot load JDBC driver class 'null'" whenever I tried to call DataSource's getConnection() method... Here's the basic structure of my app on the final server:
server.xml:


$CATALINA_HOME/common/lib:
mysql connector.jar lies here with the driver
Here's the database manager (Manager.java):


And here's the file I use to test that crap:


.. anybody has any ideas why is this happening?
It didn't happen on my home machine but it's happening on server...
JVM is 1.4.x and tomcat is 4.1
Thank you in advance, your help is GREATLY appreciated,
Ivan
Ivan Jouikov
Ranch Hand

Joined: Jul 22, 2003
Posts: 269
BTW, mysql contains the the valid user with the valid password @ my host with all privileges set to him and access to all the databases.
Ivan Jouikov
Ranch Hand

Joined: Jul 22, 2003
Posts: 269
oh yeah, a few things I forgot:
CLASSPATH contains an entry for mysql-connector.jar
web.xml contains the following regarding the database:
<!-- Database -->
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/marina</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot load JDBC driver class 'null' ... WTF?