9

Hi
I have two web application under one tomcat. Both are using hibernate 3.2.1 and c3p0 0.9.1.2. While the second application gets deployed, I always get the following warning message.
Tomcat: apache-tomcat-6.0.28

WARN 2010-11-06 19:04:37,270 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.

Please help in this regard.

Thanks in advance
Goura

Goura
  • 101
  • 1
  • 2
  • 7

2 Answers2

10

To avoid the C3P0Registry from being loaded and registered multiple times (when deploying multiple webapps, when reloading a given webapp), my recommendation would be to move the C3P0 JAR (and the JDBC driver) from the Webapp classloader (WebappX/WEB-INF/lib) to the Common classloader ($TOMCAT_HOME/lib).

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
5

If you dont want c3p0 exposed through JMX then you could do:

com.mchange.v2.c3p0.management.ManagementCoordinator=com.mchange.v2.c3p0.management.NullManagementCoordinator
cherouvim
  • 31,725
  • 15
  • 104
  • 153