本文主要是介绍警告处理 A C3P0Registry mbean is already registered. This probably means that an application using c3p.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
遇到完整的警告信息如下:
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.
遇到此警告通常是在同一个web容器下部署了多个使用c3p0的项目(例如:tomcat下面部署了多个使用c3p0的webapp)。
解决的方法可以是:
1.如果你不使用JMX,那么你可以在src下建立一个c3p0.properties,内容如下:
com.mchange.v2.c3p0.management.ManagementCoordinator=com.mchange.v2.c3p0.management.NullManagementCoordinator
2.建议将项目内(例如:WebappX/WEB-INF/lib
)的c3p0的相关依赖包(C3P0的jar和JDBC driver的jar)删除,将这些包转移到容器的共享lib目录下(例如:$TOMCAT_HOME/lib
)
问题解决。
参考:http://stackoverflow.com/questions/4113759/multiple-applications-having-c3p0-configuration-gives-warning
这篇关于警告处理 A C3P0Registry mbean is already registered. This probably means that an application using c3p.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!