Re: Tomcat 5.5.9, correct directory for DB driver?



"elektrophyte" <moctile@xxxxxxxxx> said:
>I've tried putting the DB driver "mysql-connector-java-3.1.8-bin.jar"
>in these locations:
>
>[TOMCAT_HOME]\common\lib
>[TOMCAT_HOME]\common\endorsed
>[TOMCAT_HOME]\webapps\agenda\WEB-INF\lib
>C:\Program Files\Java\jdk1.5.0_01\jre\lib\ext
>
>These are all directories that have been recommended in books, in
>Tomcat docs, or in newsgroups as the place to put jar files like DB
>drivers. I don't know if one, some, none, or all is the right
>directory. In fact it seems to be one of the great mysteries of the
>universe. Maybe there's an old guy sitting on top of a mountain in
>Tibet who knows what the correct directory for database drivers is.

Read, and re-read, the Tomcat classloading documentation. Digesting
it will take some time - just accept that.

Then, if you create the database connections as you should (i.e.
by using the jdbc connection pooling support provided by Tomcat,
instead of creating the connections within your application),
place the library in common/lib. And make sure you don't have
compies of the library elsewhere -- there could be one hiding in
the Tomcat work directory for your webapp.

>The error -->
>================================================================
>Cannot create JDBC driver of class '' for connect URL 'null'
>org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
>driver of class '' for connect URL 'null'
>
>[...]
>
>Caused by: java.sql.SQLException: No suitable driver
> at java.sql.DriverManager.getDriver(DriverManager.java:243)

.... but this somewhat looks like there isn't even an attempt to
load the mysql driver -- which could be caused by a bug in your
configuration.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
.



Relevant Pages

  • Re: Preload JDBC Drivers in Tomcat
    ... > I am trying to preload the DB2 JDBC driver in Tomcat. ... application to Tomcat at an unlikely context root. ... A servlet that does nothing. ... It must be a servlet however, because you want to implement its init() ...
    (comp.lang.java.databases)
  • Re: Preload JDBC Drivers in Tomcat
    ... > I am trying to preload the DB2 JDBC driver in Tomcat. ... application to Tomcat at an unlikely context root. ... A servlet that does nothing. ... It must be a servlet however, because you want to implement its init() ...
    (comp.lang.java.help)
  • Re: Upgrading SQL Server 2005 JDBC Driver 1.1 from SQL Server 2000 Driver, in Tomcat 5.5 env
    ... Our broken pipe error is only a warning. ... in the 5.5.16 version of tomcat. ... Please update me on your driver situation. ... Tomcat seemed to be hanging onto bad connection pool ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Preload JDBC Drivers in Tomcat
    ... I am trying to preload the DB2 JDBC driver in Tomcat. ...
    (comp.lang.java.help)
  • Preload JDBC Drivers in Tomcat
    ... I am trying to preload the DB2 JDBC driver in Tomcat. ...
    (comp.lang.java.databases)