tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jill Stephenson <>
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;
2) Class.forName("").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!


> 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 ( stop and then 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(
>         at java.sql.DriverManager.getConnection(
-- 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:
> 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.
> 805-565-1411 PH * 805-565-8684 FAX

View raw message