2
org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure HHH000342: Could not obtain connection to query metadata : Cannot load JDBC driver class 'com.postgresql.jdbc.Driver'

I'm getting this warning while starting my application, can you help me how to solve it? It's WARN, no error or exception. (it is in my maven,spring,hibernate application), i have exceptions when i want to access my database via hibernate, but i'm not sure if this is causing the problem, thanks.

10
  • Looks like the postgresql.jar is missing in your classspath. Commented Jun 27, 2014 at 21:25
  • @Jens .jar file into classpath? can you explain what exactly should i do? what jar file? Commented Jun 27, 2014 at 21:32
  • Hereyou can download the jar contains the postgressql Driver. How do you start your application? Commented Jun 27, 2014 at 21:35
  • 1
    If you're using Maven, ignore the people talking about manipulating the jar directly and declare it as a dependency. Commented Jun 28, 2014 at 0:26
  • 1
    Since I cannot add an answer to your question because it was already answered elsewhere ( still not very satisfying to me ), I will add an comment: Since you are using idea and maven please check this path project structure -> artifacts -> <yourAppName:war exploded> -> output layout tab -> WEB-INF -> lib and check if you have there in the lib folder all the dependencies from pom.xml. I don't know why this folder wasn't being updated by Maven. Here is the location where all your jars should be ( as stated in the accepted answer). Maybe I've, like you have, missed a configuration or something Commented Apr 13, 2015 at 21:14

1 Answer 1

3

Add the dependency on the postgresql driver to your pom.xml file

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.3-1101-jdbc41</version>
</dependency>
Sign up to request clarification or add additional context in comments.

3 Comments

i already have this dependency
Are you using eclipse?
im using intelij idea

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.