异常如下:
严重: The web application [] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2011-1-17 14:57:03 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [] registered the JBDC driver [org.apache.derby.jdbc.ClientDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2011-1-17 14:57:03 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
2011-1-17 14:57:03 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
这个主要是DBCP的bug在如下链接中已经提出:
https://issues.apache.org/jira/browse/DBCP-332
BasicDataSource's method close() doesn't deregister JDBC driver. This causes permgen memory leaks in web server environments, during context reloads. For example, using Tomcat 6.0.26 with Spring, and BasicDataSource declared in Spring context, there is a message printed at web application reload:
SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
I was able to fix it by overriding close method this way:
public class XBasicDataSource extends BasicDataSource {
@Override
public synchronized void close() throws SQLException {
DriverManager.deregisterDriver(DriverManager.getDriver(url));
super.close();
}
}
but I think it should be probably the default behavior of BasicDataSource. Or perhaps there should be some flag/setting on BasicDataSource, named "deregisterDriverAtClose" or so.
分享到:
相关推荐
The web application [web application] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC...
SEVERE: The web application [/xxx] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has ...
DB2 Driver是IBM公司开发的一款专门用于连接DB2数据库的驱动程序,它是Java数据库连接(JDBC)的一部分,使得Java应用程序能够与DB2数据库进行交互。在描述中提到的问题,对于Mac用户来说,使用DBeaver这样的数据库...
首先,错误信息 "严重: The web application [/img] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped." 指出,在停止Web应用/img时,它注册...
* MySQL 数据库:使用 org.gjt.mm.mysql.Driver 驱动程序,连接字符串为“jdbc:mysql://localhost/myDB?user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1”。 * PostgreSQL 数据库:使用 org....
<br>原文件说明: <br>Compuware DriverStudio – DriverSuite Version 3.2 <br>Version 3.2 VisualStudio 2005 Integration fix. The purpose of this update is to allow DriverStudio – ...
在“i2c_driver2.rar”压缩包中的“I2C驱动2.pdf”文档很可能详细介绍了如何编写和调试I2C驱动程序,包括实例代码和步骤指南。而“www.pudn.com.txt”可能是提供额外资源链接或参考材料的文本文件。 在实际开发中,...
I have not been able to reproduce these errors, but I believe the following work around will fix the problem: In the project options of *all* projects which uses these components, add the following...
4. **驱动编程接口**:详细说明如何使用`<linux/pci.h>`头文件中的函数和数据结构来编写PCI驱动,如`pci_register_driver()`和`pci_unregister_driver()`。 5. **中断处理**:解释中断请求(IRQ)的管理和处理,...
Windows Installer注册表修复工具 作者源址:https://gist.github.com/heaths/77fbe0b44496960fab25c2eb0b9e8475
`kernel_char_driver.tar.gz_operation`这个项目显然是为了帮助开发者理解如何编写一个简单的字符设备驱动,特别关注于LED(发光二极管)的控制。在这个教程中,你将学习到如何在Linux内核中进行以下操作: 1. **主...
这通常通过调用`unregister_led_classdev`完成。 4. **用户空间与内核空间交互** - 为了使用户空间程序(如测试程序)能够控制LED,通常会使用字符设备驱动模型。通过创建设备节点(如`/dev/led`),用户空间程序...
The Online Edition is similar to the Standard Edition, but the files for repairing are not included in Online Edition. Consequently, Internet connection is required when it is repairing the files. ...
每个总线都有自己的探测方法,如PCI的`pci_register_driver`和`pci_unregister_driver`。 总的来说,这个压缩包中的源代码涵盖了Linux设备驱动开发的多个重要方面,包括设备模型、驱动注册、中断处理、I/O操作以及...
"rtc-ep93xx.rar_The Driver" 提供的是针对Cirrus Logic EP93XX处理器内建RTC模块的驱动程序。驱动程序是操作系统与硬件设备之间的桥梁,它允许操作系统和应用程序能够有效地访问和利用硬件资源。RTC驱动负责初始化...
- 当不再需要驱动时,使用`unregister_chrdev()`来注销驱动,释放资源。 3. **设备文件创建** - `mknod`命令或在驱动中调用`cdev_add()`可以创建设备文件,使得用户空间可以通过文件系统接口与设备交互。 4. **...
以下将详细阐述平台驱动(Platform Driver)和平台设备(Platform Device)的概念、结构以及它们在Linux内核中的工作原理。 平台驱动(Platform Driver): 平台驱动是针对特定硬件平台设计的,它负责初始化、配置...
第一步:如果已经安装过Zend Studio 9.0的,请打开Zend Studio 9.0,在菜单中“help>Unregister”,如果显示是灰的跳过此步退出Zend Studio。如果显示可以点击的请点击,这时Zend Studio会重启,重启到要求你填注册码...
10. **卸载驱动**:当不再需要驱动时,通过`pci_unregister_driver()`卸载。这会解除设备与驱动的关联,释放资源。 在压缩包中的"PCI驱动范例"文件,开发者可以学习如何编写和调试PCI驱动,包括如何初始化设备,...
本文将基于提供的“linux_uart_driver.rar”压缩包文件,深入探讨Linux串口驱动的开发,包括其工作原理、设计流程及相关的编程知识。 首先,我们要理解Linux内核中的串口驱动是如何工作的。在Linux中,串口驱动属于...