File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes jdbc error at runtime - org.postgresql.Driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc error at runtime - org.postgresql.Driver" Watch "jdbc error at runtime - org.postgresql.Driver" New topic
Author

jdbc error at runtime - org.postgresql.Driver

Eduardo Ponce de Leon
Ranch Hand

Joined: May 13, 2009
Posts: 99
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.



[Thumbnail for pic.JPG]

Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

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.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Eduardo Ponce de Leon
Ranch Hand

Joined: May 13, 2009
Posts: 99
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

Joined: Sep 10, 2011
Posts: 18
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

Joined: Apr 20, 2010
Posts: 27

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

Joined: May 13, 2009
Posts: 99
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

Joined: May 13, 2009
Posts: 99
Thank you all for the help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdbc error at runtime - org.postgresql.Driver