Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

ClassNotFoundException Error

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 4278
34
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 40796
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this is more of an Eclipse question than a JDBC question, so I'm moving it to our IDEs forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic