org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider 提供商 class 未找到

org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider provider class was not found

下面是我使用的c3p0配置。

        <property name="hibernate.c3p0.timeout">500</property>
        <property name="hibernate.c3p0.idle_test_period">3000</property>
        <property name="c3p0.min_size">20</property>
        <property name="c3p0.max_size">100</property>
        <property name="testConnectionOnCheckin">true</property>
        <property name="hibernate.c3p0.debugUnreturnedConnectionStackTraces">true</property>
        <property name="hibernate.c3p0.unreturnedConnectionTimeout">60</property>

我查看了我的日志,发现 "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."

我用了2个库。 c3p0-0.9.1.jar & hibernate-c3p0-4.1.4.final-sources.jar

请帮忙...

org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider provider class was not found on the classpath

因为您使用的是 hibernate-c3p0-4.1.4.final-sources.jar 并且此 jar 仅包含 Java 源代码(.java) 文件不是编译的 Java 代码 (.class)。因此,即使您期望 "C3P0ConnectionProvider" class 在您的 class 路径中,但实际上并非如此。

解决方案

使用"hibernate-c3p0-4.1.10.Final.jar"。此 jar 包含 C3P0ConnectionProvider.class 个文件。

希望这能解决您的问题。