File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error : class not found exception : com.mysql.jdbc.driver in eclipse Tool

 
Harshal Gurav
Ranch Hand
Posts: 151
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have impoted project file in eclipse in new machine using option import from existing workbence . When i stat to debug this project ,
i am getting error as class not found exception : com.mysql.jdbc.driver . my project folder already consist of mysql .jar file in /web appls/web-inf folder.
Application is running successfully in other machine from where i took the application file. As this error appeared I also added jar file into project path as Project ---->properties-- build java path---libraries----add external jar file.
kindly hep me.

Haresh
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might have better luck with this question in the IDEs forum because Eclipse sometimes does strange things when deploying web applications. I'll move it for you.

By the way, the JDBC JAR file should be in WEB-INF/lib (though that sometimes depends on the app server you are using, you should let us know which app server you have).
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please make sure to capitalize things properly, like WEB-INF and Driver, as these things are different, and significant.
 
Arati Patro
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This reply is wrt the error: class not found exception : com.mysql.jdbc.driver in eclipse Tool in a Dynamic Web App.( Tomcat Server)

I faced the same and figured that apart from adding the mysqlconnector jar to the class buildpath(Project->Properties->Java Build Path->Add External Jar), you need to copy paste the jar in the WEBINF folder of your project as well.
Ideally, restart IDE after this.

Hope this helped.

Arati Patro, Bangalore
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I take it you are using Eclipse.
I faced the same and figured that apart from adding the mysqlconnector jar to the class buildpath(Project->Properties->Java Build Path->Add External Jar), you need to copy paste the jar in the WEBINF folder of your project as well. Ideally, restart IDE after this.

Not really. As Peter mentioned, it should be under WEB-INF/lib. Once you put it there, its an "internal" jar! No restart required.

..wrt..

Please UseRealWords
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic