具有c3p0配置的多个应用程序会发出警告 [英] Multiple applications having c3p0 configuration gives warning

查看:318
本文介绍了具有c3p0配置的多个应用程序会发出警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi

我在一个tomcat下有两个web应用程序。两者都使用hibernate 3.2.1和c3p0 0.9.1.2。当第二个应用程序被部署时,我总是会收到以下警告消息。

Tomcat: apache-tomcat-6.0.28


WARN 2010-11-06 19:04:37,270 C3P0Registry mbean已经注册。这可能意味着使用c3p0的应用程序已取消部署,但并非所有PooledDataSources在取消部署之前都已关闭。这可能会导致资源泄漏。请注意关闭所有PooledDataSources。

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.

请在这方面提供帮助。

在此先感谢

Goura

Thanks in advance
Goura

推荐答案

为避免 C3P0Registry 多次加载和注册(在部署多个webapp时,在重新加载给定的webapp时),我的建议是将C3P0 JAR(和JDBC驱动程序)从 Webapp classloader( WebappX / WEB-INF / lib )添加到 Common 类加载器( $ TOMCAT_HOME / lib )。

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).

这篇关于具有c3p0配置的多个应用程序会发出警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆