Hibernate – Could not find C3P0ConnectionProvider

Problem

Configured Hibernate to use “c3p0” connection pool, but hits following warning :


//...
2011-04-25_12:18:37.190 WARN  o.h.c.ConnectionProviderFactory - 
c3p0 properties is specificed, but could not find 

org.hibernate.connection.C3P0ConnectionProvider from the classpath,
 these properties are going to be ignored.
2011-04-25_12:18:37.191 INFO  o.h.c.DriverManagerConnectionProvider - 
Using Hibernate built-in connection pool (not for production use!)
//...

Look like “org.hibernate.connection.C3P0ConnectionProvider” is missing?

Solution

Since Hibernate v3.3 (if not mistaken), the “C3P0ConnectionProvider” is moved to another jar file “hibernate-c3p0.jar“. You need to include it, in order to make Hibernate supports c3p0 connection pool.

You can download the “hibernate-c3p0.jar” from JBoss public repository.

File : pom.xml


<project ...>

	<repositories>
		<repository>
			<id>JBoss repository</id>
			<url>http://repository.jboss.org/nexus/content/groups/public/</url>
		</repository>
	</repositories>

	<dependencies>

		<!-- Hibernate c3p0 connection pool -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-c3p0</artifactId>
			<version>3.6.3.Final</version>
		</dependency>

	</dependencies>
</project>

Note
See this detail guide – “How to configure c3p0 connection pool in Hibernate“.

Reference

  1. http://docs.jboss.org/hibernate/core/3.3/api/org/hibernate/connection/C3P0ConnectionProvider.html
  2. http://sourceforge.net/projects/c3p0/

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
0 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Recent comment authors
newest oldest most voted