当前位置:首页 > 开发 > 数据库 > 正文

A C3P0Registry mbean is already registered

发表于: 2012-04-23   作者:bozch   来源:转载   浏览:
摘要: 在同一个tomcat下部署多个项目的时候,出现了如下警告: 2012-04-23 13:41:02,120  WARN (com.mchange.v2.c3p0.management.ActiveManagementCoordinator:56) - A C3P0Registry mbean is already registered. This probably means that

在同一个tomcat下部署多个项目的时候,出现了如下警告:
2012-04-23 13:41:02,120  WARN (com.mchange.v2.c3p0.management.ActiveManagementCoordinator:56) - 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.

意思是C3P0Registry mbean已经被注册过啦!的确是已经在其他项目中已经对其进行了注册。

解决方案:将所有项目的将c3po和数据库驱动放到tomcat的lib下。

如果是单独一个使用c3p0的项目放在tomcat下,打出的日志是:2012-04-23 13:48:47,289  INFO (com.mchange.v2.c3p0.C3P0Registry:204) - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

英文:
        We had this problem when we were trying to deploy multiple applications within same tomcat. So it was a case of multiple class loaders within same VM.
       
        How did we solve this ?
       
        We moved the jar files from WEB-INF of each folder to the tomcat/lib directly.
       
        Files moved
       
        c3p0-0.9.1.jar
       
        mysql-connector-java-5.1.7-bin
       
        This solved the problem.
       
        We were also seeing some out of memory problems which are not happening right now.
       
        Refer to C3P pool documentation
       
        http://www.mchange.com/projects/c3p0/index.html
       
        http://www.mchange.com/projects/c3p0/index.html

A C3P0Registry mbean is already registered

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号