3

After my project is deployed a few times, I get this log and it just pauses there. I have to re-run my project afterwards. How can I solve this and prevent in future?

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>
Sanal S
  • 1,105
  • 14
  • 27
  • 1
    Please share some configuration of your project like how c3p0 data source is initialized and if you're using a framework like spring or something else to configure it. – Luiggi Mendoza Feb 24 '16 at 04:19
  • does [this](http://stackoverflow.com/q/4113759/4290096) help ? – Arun Xavier Feb 24 '16 at 04:22
  • @LuiggiMendoza Is this what u asked for? No spring, only hibernate. – Sanal S Feb 24 '16 at 10:16
  • 1
    @ᴊᴀᴠʏ I am not running multiple applications, and by 'Common classloader' u meant, i have to add jar files to 'Program Files\glassfish-4.0\glassfish\lib\' ? – Sanal S Feb 24 '16 at 10:18

1 Answers1

0

From the info log, it seems that you are using JMX server/JMX MBeanServer. Use JMX tool bundled with JDK, such as Jconsole to edit the datasource's configuration properties. You will find that c3p0 registers MBeans under the domain com.mchange.v2.c3p0 and an MBean for each PooledDataSource you deploy.

If you do not explicitly set a RegistryName, then full JMX ObjectName would be

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

The above value is default and hibernate/application is trying to initialize c3p0 with the same registry bean(default).

Please set the registry in your config/properties file. For eg:

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

If the above solution does not work, disable JMX support. System property to disable JMX support is:

com.mchange.v2.c3p0.management.ManagementCoordinator=com.mchange.v2.c3p0.management.NullManagementCoordinator
StackzOfZtuff
  • 2,534
  • 1
  • 28
  • 25
vicky77
  • 19
  • 1