tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jill Stephenson <ji...@dstc.qut.edu.au>
Subject Re: Strange Intermittent Problems with Tomcat 3.2 beta 2 and MySQL
Date Mon, 14 Aug 2000 21:56:23 GMT
I understand that there is some sort of race condition in Java 1.1.x 
that can cause the loading of the driver to fail, which in turn will 
mean that your getConnection will fail as below.  

Two ways I have seen to work around it are
1) DriverManager.registerDriver (new org.gjt.mm.mysql.Driver());
2) Class.forName("org.gjt.mm.mysql.Driver").newInstance();

I am using the second way with Tomcat 3.1, JDK 1.2.2 and mm.mysql 2.0.1.

I don't know whether I actually need to use this method with Java 1.2,
however it has been working fine to date, so I guess I'll stick with it!

----
Jill


> I am using the mm.mysql driver to access my database via JSP. I am 
> running Tomcat 3.2 beta 2.
>
> I am having intermittent problems with the driver loading. After I 
> restart the server (tomcat.sh stop and then tomcat.sh start from the 
> same console it was started from before), I get this error:
>
> Root cause: 
> java.sql.SQLException: No suitable driver
>         at java.sql.DriverManager.getConnection(DriverManager.java:537)
>         at java.sql.DriverManager.getConnection(DriverManager.java:199)
-- snip --
> The driver is in a .jar file which I know is in the CLASSPATH. It's 
> also in my lib/ directory for my webapp - shouldn't the classpath be 
> handled automatically?
>
> Here is my classpath:
>CLASSPATH=/usr/local/src/intranet/lib:/usr/local/jdk1.3/lib/jaxp.jar:/usr/local
/jdk1.3/lib/parser.jar:/usr/local/jdk1.3/lib/tools.jar
>
> My driver is in /usr/local/src/intranet/lib and also in the lib/ 
> directory of my webapp.
>
> Any ideas? This happened before and all of a sudden the site came 
> back to life. I don't know what I did to make it start working again
> but it wasn't anything significant.
>
>
> Hunter Hillegas, MCP
> Web Engineer / System Administrator - Jacob Stern & Sons, Inc.
> hhillegas@jacobstern.com
> 805-565-1411 PH * 805-565-8684 FAX



Mime
View raw message