繁体   English   中英

Hibernate c3p0 初始化错误

[英]Hibernate c3p0 initialization error

在我的项目部署几次后,我得到了这个日志,它只是在那里暂停。 之后我必须重新运行我的项目。 我怎样才能解决这个问题并在未来预防?

Info:   Initializing c3p0-0.9.2-pre2 [built 18-May-2012 10:14:10 -0400; debug? true; trace: 10]

Warning:   A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were closed prior to undeployment. This may lead to resource leaks over time. Please take care to close all PooledDataSources.

Info:   Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@f63e045c [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@7aab8919 [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13c9f3qzb1d180wvxe|f1928e0, idleConnectionTestPeriod -> 0, initialPoolSize -> 1, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@3a5a11 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1hge13c9f3qzb1d180wvxe|1311a587, jdbcUrl -> jdbc:mysql://192.168.1.13:3306/medi_soft?autoReconnect=true, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 1hge13c9f3qzb1d180wvxe|79fef582, numHelperThreads -> 3 ]



    <!-- c3p0 Connection Pool Properties -->
    <property name="hibernate.connection.pool_size">1</property>
    <property name="hibernate.c3p0.min_size">1</property>
    <property name="hibernate.c3p0.max_size">100</property> 
    <property name="hibernate.c3p0.timeout">0</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.idle_test_period">0</property>

从信息日志中,您似乎正在使用 JMX 服务器/JMX MBeanServer。 使用 JDK 自带的 JMX 工具,例如 Jconsole 来编辑数据源的配置属性。 您会发现 c3p0 在域com.mchange.v2.c3p0下注册了 MBean,并为您部署的每个PooledDataSource注册了一个 MBean。

如果您没有明确设置 RegistryName,则完整的 JMX ObjectName 将是

com.mchange.v2.c3p0:type=C3P0Registry.

上面的值是默认值,hibernate/application 正在尝试使用相同的注册表 bean(默认值)初始化 c3p0。

请在您的配置/属性文件中设置注册表。 例如:

com.mchange.v2.c3p0:type=C3P0Registry,name=C3P0Registrynew

如果上述解决方案不起作用,请禁用 JMX 支持。 禁用 JMX 支持的系统属性是:

com.mchange.v2.c3p0.management.ManagementCoordinator=com.mchange.v2.c3p0.management.NullManagementCoordinator

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM