Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc error at runtime - org.postgresql.Driver

 
Eduardo Ponce de Leon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting this error when trying to conncet to my DB...



it is funny because it only hapens when running my app, when I run it in a simple java file it works fine...


Why am I getting this error..

I am attaching a pic showing that the driver has been configured on my IDE.

pic.JPG
[Thumbnail for pic.JPG]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like the driver isn't in the classpath. put this jar under your tomcat/lib or in WEB-INF/lib directory.

hope its helps.
 
Eduardo Ponce de Leon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running my app from eclipse, i dunno if that makes a difference.. I dont have anything on my tomcat folder!
 
Patryk Sosinski
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You got ServletException so it is some kind of web application (maybe you got embedded tomcat server in eclipse). It is normal that when you run standalone java class all jars are taken from classpath, but when you deploy application to servlet container you need to put those jars in for example WEB-INF/lib directory as they are not deployed.
 
hemantha kumar k
Greenhorn
Posts: 27
Hibernate Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running my app from eclipse, i dunno if that makes a difference.. I dont have anything on my tomcat folder!

Really it does make difference, since your adding the jar file to eclipse, only eclipse knows where actually jar file is located, but when it comes to running on the any server(tomcat), server should know where jar files are located, when we consider tomcat you should place jar files inside WEB-INF/lib folder then only tomcat come to know about that project an your getting the error from tomcat not from eclipse, eclipse is an IDE which helps while coding, if you add you jar in class path then it will only eclipse come to know not your web server, always your web server search jar file in WEB-INF/lib folder
 
Eduardo Ponce de Leon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that is weird, yesterday it was working fine. The .jar was in that folder, i delete the file and add it again and it is working fine now.
 
Eduardo Ponce de Leon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for the help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic