• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MySQL Error - no driver

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

Yes another MySQL error post.

I've read through the other posts but cant seem to get to the bottom of my problem.

I've put the MySQL driver jar file in the common's folder. It is also in my buildpath too.

my error is as follows:



Where could this problem be? the web.xml? server.xml?? the driver itself? my code is from here

My web.xml is as follow. Server.xml follows the



Any ideas? It's driving me mad now.

Thanks in advance regards
Zein

PS: I didnt want to cross post, unfortunately I think this is a half server half JDBC problem.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where is the connection pool class located?
My guess at the moment is that you have a classloader problem in the location of your two jars. Personally I would delete them both from from where ever they are and place them both in the <context>/WEB-INF/lib directory.
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys

RE: the previous post.

where is the connection pool class located?



Is this the .jar file (mysql-connector-java-5.0.4-bin-g.jar)?? I copied this into the ....Tomcat 5.5\common\lib directroy only.

Now, as Dave said above I moved to the webapps/myapp/WEB-INF/lib (so there is only one copy). Still I have the same problem.

It seems to be quite a basic thing to be honest, i'm sure alot of people must have had this sort of issue?

Oh and the jar file is in my IDE's classpath too.

Any ideas?? Considering :P

Thanks in advance
Zein
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The message is no suitable driver.

Did you check if the mysql driver is compatible with with your mysql version.

Is it tested in a standalone program without Tomcat.

I had once the same problem, which was solved by putting the right JDBC-driver.

Also check if in Tomcat there is no cross reference to a different driver, but I understand this is already done.
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cannot create JDBC driver of class '' for connect URL 'null'



The driver factory looks up the driver that matches your connect string.
Your connect string seems to be empty.

Looking from your post, you've created a resource reference to a datasource, but you haven't defined the resource itself (jdbc/TestDB) completely.

In the howto page you talk about in your first post, there is a section for server.xml, where you have to define the datasource.



Did you include this in your setup?

Regards, Jan
[ February 17, 2007: Message edited by: Jan Cumps ]
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

Still stuck on this problem.

MySQL works on its own fine. I have entered data, no problem. I can also retrieve the required data.

I'm trying to run the connection stand alone (as recommended by Wilhelm Tell, above), this is causing problems. I have the driver in the classpath but I still have error


(I have read that this is due to the driver not being configured properly).

I added the jar to my classpath (i'm using eclipse), it shows that it is in the classpath too.

MySQL is version 5.0.27 driver version is mysql-connector-java-5.0.4-bin-g.jar

Any cues?
Thanks in advance.

Zein
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Further to the abover I have my database on my C:\ drive, not on a server or anything. Is this ok? (even when I connect to the MySQL via Tomcat).

Thanks
Zein
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're getting that error, it doesn't have anything to do with the driver. It means that your .class file can't be found.

Eclipse and other IDEs often override the system CLASSPATH. What is the CLASSPATH you have?
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok guys,

I've finally got to the bottom of this problem.

Yes also as Keith mentioned in the above post the classpath for the class I was executing had to be set (I write all my test programs in another package which wasn't in the classpath).

The mysql-connector-java-5.0.4-bin-g.jar has to be placed in the C:\Program Files\Java\jre1.5.0_07\lib\ext folder on my computer even though I thought adding to the classpath would have been sufficient. I found this on a MySQL.com website forum. - A lot of people seem to have the same problem as the MySQL documentatiion (& the Apache Tomcat) doesn't mention this.

If anyone has outstanding issues regarding this mail me whenever.

Now that I have the DB running locally, I'll be testing it on my webserever.

A big thanks to all that helped.

Zein
reply
    Bookmark Topic Watch Topic
  • New Topic