Hibernate - Impossible de trouver C3P0ConnectionProvider
Problème
Configuré Hibernate pour utiliser le pool de connexion «http://sourceforge.net/projects/c3p0/[c3p0]», mais il affiche l'avertissement suivant:
//... 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!) //...
Il semble que «org.hibernate.connection.C3P0ConnectionProvider
» est manquant?
Solution
Depuis Hibernate v3.3 (si ce n'est pas une erreur), le «C3P0ConnectionProvider» est déplacé vers un autre fichier jar «hibernate-c3p0.jar». Vous devez l'inclure afin que Hibernate prenne en charge le pool de connexions c3p0.
Vous pouvez télécharger les «hibernate-c3p0.jar» à partir du référentiel public JBoss.
Fichier: pom.xml
JBoss repository http://repository.jboss.org/nexus/content/groups/public/ org.hibernate hibernate-c3p0 3.6.3.Final
Note
Consultez ce guide détaillé - «http://www.example.com/hibernate/how-to-configure-the-c3p0-connection-pool-in-hibernate/[Comment configurer pool de connexions c3p0 dans Hibernate] ».