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