Java 休眠c3p0初始化错误

Java 休眠c3p0初始化错误,java,hibernate,c3p0,glassfish-4,Java,Hibernate,C3p0,Glassfish 4,在我的项目部署了几次之后,我得到了这个日志,它只是在那里暂停。之后我必须重新运行我的项目。我如何解决这个问题并在将来预防 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 applicati

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

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>
Info:初始化c3p0-0.9.2-pre2[Build 18-May-2012 10:14:10-0400;调试?正确;跟踪:10]
警告:C3P0MBean注册表已注册。这可能意味着使用c3p0的应用程序已取消部署,但并非所有PooledDataSources在取消部署之前都已关闭。随着时间的推移,这可能会导致资源泄漏。请注意关闭所有池数据源。
信息:正在初始化c3p0池。。。com.mchange.v2.c3p0。PoolBackedDataSource@f63e045c[connectionPoolDataSource->com.mchange.v2.c3p0。WrapperConnectionPoolDataSource@7aab8919 [acquireIncrement->3,AcquireEntryAttributes->30,AcquireEntryDisplay->1000,自动提交关闭->假,自动测试表->空,在AcquireFailure->假,签出超时->0,connectionCustomizerClassName->空,ConnectionTestClassName->com.mchange.v2.c3p0.impl.DefaultConnectionTester,DebuggeUnreturnedConnectionsTackTraces->false,factoryClassLocation->null,ForceIgnoreUnsolvedTransactions->false,identityToken->1HGE13C9F3QZB1180WVXE | f1928e0,idleConnectionTestPeriod->0,initialPoolSize->1,maxAdministrativeTaskTime->0,maxConnectionAge->0,maxIdleTimeExcessConnections->->0,maxPoolSize->100,maxStatementsPer->0,maxStatementsPer连接->0,最小池大小->1,嵌套数据源->com.mchange.v2.c3p0。DriverManagerDataSource@3a5a11[description->null,driverClass->null,factoryClassLocation->null,identityToken->1HGE13C9F3QZB1180WVXE | 1311a587,jdbcUrl->jdbc:mysql://192.168.1.13:3306/medi_soft?autoReconnect=true,属性->{user=*******,password=******}],preferredTestQuery->null,propertyCycle->0,statementCacheNumDeferredCloseThreads->0,testConnectionOnCheckin->false,testConnectionOnCheckout->false,unreturnedConnectionTimeout->0,UseStraditionalReflectionProxies->false;用户覆盖:{}],dataSourceName->null,factoryClassLocation->null,identityToken->1hge13c9f3qzb1d180wvxe | 79fef582,numHelperThreads->3]
1.
1.
100
0
0
0

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

如果您没有显式设置RegistryName,那么完整的JMX ObjectName将是

com.mchange.v2.c3p0:type=C3P0Registry.
上面的值是默认值,hibernate/应用程序正在尝试使用相同的注册表bean(默认值)初始化c3p0

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

com.mchange.v2.c3p0:type=C3P0Registry,name=C3P0Registrynew
如果上述解决方案不起作用,请禁用JMX支持。禁用JMX支持的系统属性为:

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

请分享您的项目的一些配置,比如c3p0数据源是如何初始化的,以及您是否使用spring之类的框架或其他东西来配置它。是否有帮助?@LuiggiMendoza这就是您所要求的吗?没有spring,只有hibernate@ᴊᴀᴠʏ我没有运行多个应用程序,你所说的“通用类加载器”是指,我必须将jar文件添加到“Program files\glassfish-4.0\glassfish\lib\”中?