tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wilhelm Colln <wilh...@interaccess.com.pe>
Subject Re: Strange Intermittent Problems with Tomcat 3.2 beta 2 and MySQL
Date Fri, 18 Aug 2000 02:27:49 GMT
Jill:

Please help, where should I declare the classpath for the mm class ?
I just added the jar file to WEB-INF/lib directory and also the
org/gjt/.../*.class files to the WEB-INF/classes/org directory
The "reloadable" parameter is "true" for the examples directory where
I have my jsp files invoking the mysql driver.

It worked fine with ApJServ and gnujsp, now with Tomcat I can't access
the DB.

Thanks.

Wilhelm


Jill Stephenson wrote:

> 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