Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate: C3P0 properties ignored

I'm getting the following warning:

15:41:51,043 WARN  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-1) HHH000022: c3p0 properties were encountered, but the org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider provider class was not found on the classpath; these properties are going to be ignored.

Here are the properties as set in my Hibernate.xfg.xml:

<property name="hibernate.c3p0.min_size">50</property>
<property name="hibernate.c3p0.max_size">200</property>
... (and other properties)

I don't have any other configuration about C3P0, aside the above properties.

Here are all my Hibernate and C3P0 dependencies configured in the Maven pom.xml:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>4.2.4.Final</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>4.3.1.Final</version>
</dependency>

<dependency>
    <groupId>c3p0</groupId>
    <artifactId>c3p0</artifactId>
    <version>0.9.1.2</version>
</dependency>

What I need to do in order to be able to read the properties that at the moment are ignored?

like image 926
user1883212 Avatar asked Jan 20 '14 15:01

user1883212


1 Answers

From this post it appears you are missing the hibernate-c3p0 dependency

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-c3p0</artifactId>
  <version>4.1.10.Final</version>
</dependency>

You need to match the version with that used in hibernate-core

like image 78
Reimeus Avatar answered Oct 10 '22 03:10

Reimeus