警告: The web application [bank] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but

博客内容涉及Tomcat在停止web应用时未能正确注销JDBC驱动,导致出现内存泄漏警告。主要提及了DruidDriver和MySQL JDBC Driver,以及Abandoned connection cleanup thread线程可能引发的问题。
摘要由CSDN通过智能技术生成

警告: The web application [bank] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
一月 08, 2019 5:58:16 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
警告: The web application [bank] 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 been forcibly unregistered.
一月 08, 2019 5:58:16 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [bank] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:64)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor W o r k e r . r u n ( T h r e a d P o o l E x e c u t o r . j a v a : 617 ) j a v a . l a n g . T h r e a d . r u n ( T h r e a d . j a v a : 745 ) 一 月 08 , 20195 : 58 : 16 下 午 o r g . a p a c h e . c a t a l i n a . l o a d e r . W e b a p p C l a s s L o a d e r B a s e c h e c k S t a t e F o r R e s o u r c e L o a d i n g 信 息 : I l l e g a l a c c e s s : t h i s w e b a p p l i c a t i o n i n s t a n c e h a s b e e n s t o p p e d a l r e a d y . C o u l d n o t l o a d [ ] . T h e f o l l o w i n g s t a c k t r a c e i s t h r o w n f o r d e b u g g i n g p u r p o s e s a s w e l l a s t o a t t e m p t t o t e r m i n a t e t h e t h r e a d w h i c h c a u s e d t h e i l l e g a l a c c e s s . j a v a . l a n g . I l l e g a l S t a t e E x c e p t i o n : I l l e g a l a c c e s s : t h i s w e b a p p l i c a t i o n i n s t a n c e h a s b e e n s t o p p e d a l r e a d y . C o u l d n o t l o a d [ ] . T h e f o l l o w i n g s t a c k t r a c e i s t h r o w n f o r d e b u g g i n g p u r p o s e s a s w e l l a s t o a t t e m p t t o

错误信息“程序包com.alibaba.druid.proxy.jdbc不存在”通常表明Java编译器在编译过程中无法找到指定的包路径。这可能是因为以下几种原因: 1. **缺少依赖**:你的项目中没有包含这个包相关的依赖。如果你是通过Maven或Gradle这样的构建工具来管理项目的依赖,请检查你的`pom.xml`(对于Maven)或`build.gradle`(对于Gradle)文件中是否已经正确添加了对应的依赖项。例如,如果你使用Maven,确保添加了类似以下的依赖: ```xml <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>你的版本号</version> </dependency> ``` 2. **依赖未下载**:虽然在构建文件中声明了依赖,但是可能由于网络问题或者配置错误,导致构建工具没有下载到相应的jar包。确保你的网络连接正常,并且构建工具的仓库配置正确。如果是Maven项目,可以尝试执行`mvn clean install`命令来重新下载依赖。 3. **构建路径配置错误**:如果你不是通过构建工具管理依赖,而是将jar包直接添加到项目的构建路径中,确保你已经正确地添加了`druid`的jar包,并且路径没有错误。 4. **IDE缓存问题**:有时候IDE的缓存可能会导致识别不到新添加的包。尝试清理并重新构建项目,或者重启IDE。 5. **版本不兼容**:如果已经添加了依赖,但是依然报错,可能是由于其他库的版本与`druid`库的版本不兼容。检查是否有版本冲突,并尝试更新到兼容的版本。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值