0
I am successfully using Hibernate to consult a MS SQL database, but I get the message that I should not use in production.
Using Hibernate built-in connection pool (not for production use!)
....
2018-10-23 18:01:40 WARN ConnectionProviderInitiator:219 - HHH000022: c3p0 properties were encountered, but the c3p0 provider class was not found on the classpath; these properties are going to be ignored.
I chose to use the C3P0 Provider but when I include the property in "Hibernate.cfg.xml"
<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
get the bug.
Initial SessionFactory creation failed.org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
...
...
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.connection.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
My POM.XML
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-c3p0 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>5.1.16.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
How should I start the Press correctly?
Try adding this dependency https://mvnrepository.com/artifact/org.hibernate/hibernate-ehcache/5.3.7.Final
– renanvm
Unsuccessful ... on account of the tried version with .... https://search.maven.org/artifact/org.hibernate/hibernate-ehcache/5.1.16.Final/jar
– Leandro Silva
The other and maintaining the previous https://mvnrepository.com/artifact/com.mchange/mchange-commons-java/0.2.15
– renanvm
Also nothing.. same mistake
– Leandro Silva
I forgot to mention that if I do not force the property he even finds the c3p0 but gives this error . 2018-10-23 18:01:40 WARN Connectionproviderinitiator:219 - HHH000022: c3p0 properties Were encountered, but the c3p0 Provider class was not found on the classpath; These properties are going to be Ignored.
– Leandro Silva
I tried again without the property of the Provider and with the dependencies that quoted .. and even so persists the error .
– Leandro Silva