aspose file tools*
The moose likes JDBC and the fly likes ClassNotFoundException Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ClassNotFoundException Error" Watch "ClassNotFoundException Error" New topic
Author

ClassNotFoundException Error

Ghazala Islam
Ranch Hand

Joined: Nov 22, 2000
Posts: 73
Using MyEclipse IDE ,I am trying to insert a row in a MySql table in a web based project.The code is working fine in a Java project (row is being inserted) but when i 'am trying it in a web based project its not finding the JDBC driver and giving error :

" java.lang.ClassNotFoundException: No ClassLoaders found for: com.mysql.jdbc.Driver"

I am adding the driver in project by adding external jar file in
WEB-inf/lib folder but its showing the driver in project's root directory,not in web-inf/lib directory.Whats the exact problem,driver is not copied in right directory or something else?
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

What server are you running the web application in? Normal Eclipse doesn't acknowledge webapps so putting it in WEB-INF\lib would only work in the context of a server. Not sure how MyEclipse handles it.

Also, when you add a file as a library Eclipse automatically shows it in the root regardless of where it exists in the project. I would think for a webapp you wouldn't want to add it as a library, unless MyEclipse can understand this.


My Blog: Down Home Country Coding with Scott Selikoff
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30762
    
156

I think this is more of an Eclipse question than a JDBC question, so I'm moving it to our IDEs forum.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFoundException Error