aspose file tools*
The moose likes JDBC and the fly likes Tomcat4 cann't find MySQL driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Tomcat4 cann Watch "Tomcat4 cann New topic
Author

Tomcat4 cann't find MySQL driver

cnranger
Greenhorn

Joined: Sep 27, 2001
Posts: 3
why cann't Tomcat4 find MySQL driver which I put in WEB-INF\classes directory?
my bean words fine as a standalone application(CLASSPATH setting is fine), but when I try to use it in my JSP page, Tomcat just cann't find the Driver class, even thought I put org.git.mm.mysql directory structure under my web applicaiton's WEB-INF\classes directory.
Class.forName("org.gjt.mm.mysql.Driver").newInstance();

Help please!!! I have been working on it for the past 2 days ( without sleep).
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
Yes I just installed Tomcat 4.0 and the documentation doesn't say exactly what dir to put the MySQL driver in.
Anyone got it working who could tell us where to put it? (the file that is )
Bye,

------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
UPDATE:
Further testing and searching in the MySQL driver suggested long filename in CLASSPATH might be responsible so I altered the driver directory but it still doesn't work!.
BTW I'm trying on both W98 and Linux (Suse 7.2 Professional) as I have each OS installed on a separate hard disk. I have jswdk-1.0 working perfectly under both OS with database access but it doesn't support latest JSP and Servlet features and it's slow - very slow.
Any help will be apreciated.
Thanks,
Terry
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
Just brining this up tio the top again as I still haven't found the solution.
As far as I can see the MySQL dirver has to be in the classpath for Sun's JSWDK-1.0 server to work ( and it does ), so why can't Tomcat find it?

Anyone out there see what I'm doing wrong?

Thanks,
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
Steve Campbell
Ranch Hand

Joined: Dec 18, 2000
Posts: 41
I put the My Sql driver into the Jakarta\lib directory.
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
Thank you very much Steve.
I found a reference to putting the .jar file in the lib directory on a help page elsewhere yesterday and it's now working fine.
Terry
Beaumont Muni
Greenhorn

Joined: Nov 29, 2001
Posts: 5
According to the documentation the driver can be placed in several places under tomcat depending on your intention. The $CATALINA_HOME/common/lib directory an area where you can place jar files if you intend to share it amoungst other applications that you might create under tomcat 4.x. If you intend to use the driver specifically for an application and not share it out, then create a lib directory under the WEB-INF directory of your application (context) and place it there. I currently have my mm.mysql-2.0.6.jar file located in the D:\Apache Tomcat 4.0\common\lib area on windows 2000.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat4 cann't find MySQL driver