Thursday 30 January 2014

How to solve the 'Cannot load driver: org.postgresql.Driver', error while configuring data source

In Oracle Weblogic Server, when we configure the Data Source with Postgresql database we may get the error 'Cannot load driver: org.postgresql.Driver'  in the admin console while testing the connection. In Admin log you can find the below log:
<BEA-240003> <Administration Console encountered the following error: java.lang.ClassNotFoundException: Cannot load driver: org.postgresql.Driver
Solution:
  • Download the 'postgresql-8.4-701.jdbc3' or relative postgresql jar file from web.
  • Copy and paste the .jar file in 'C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib'
  • (according to your weblogic server installation)
  • Set the CLASSPATH to the above location in the Environment variables in windows
  • If it is UNIX set the path to 'LD_LIBRARY_PATH' variable
  • Restart the Admin and Managed server's
  • Now test the connection, it will work

No comments:

Post a Comment