gpt4 book ai didi

java - hibernate :C3P0 属性被忽略

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:52:57 26 4
gpt4 key购买 nike

我收到以下警告:

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.

这是在我的 Hibernate.xfg.xml 中设置的属性:

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

除了上述属性外,我没有关于 C3P0 的任何其他配置。

这是我在 Maven pom.xml 中配置的所有 Hibernate 和 C3P0 依赖项:

<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>

我需要做什么才能读取目前被忽略的属性?

最佳答案

从这里post看来您缺少 hibernate-c3p0 依赖项

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

您需要将版本与 hibernate-core 中使用的版本相匹配

关于java - hibernate :C3P0 属性被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21238305/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com