JDBC驱动程序已被强制注销的问题

记录一下JDBC驱动程序已被强制注销的问题

首先是启动项目tomcat碰到了这个问题

严重: The web application [/cctcloud] 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.

翻译成中文就是

严重:web应用程序[/cctcloud]注册了JDBC驱动程序[网址:com.alibaba.druid.proxy.DruidDriver]但在web应用程序停止时未能注销它。为了防止内存泄漏,JDBC驱动程序已被强制注销。

错误的原因是
由于idea没有将修改后的jar发布出去(我的用的是idea,至于eclipse,好久没碰了)

解决办法
Ctrl+Alt+Shift+S弹出Project Structure窗口,在Artifacts选项到Output Layout标签中找到Available Elements,右键点击Put into Output Root,执行后,在WEB-INF会增加lib目录,里面是项目引用的jar包,点击OK。再次部署应用就能成功运行了。

在这里插入图片描述
结语
这个问题弄了老半天,百度都什么tomcat配置,注释掉监听器,治标不治本。还有换jdk的换tomcat的,自己写监听器的,太麻烦了

展开阅读全文

tomcat8 启动时异常,为防止内存泄露,jdbc驱动程序未注册

10-31
2017-10-31 23:47:15,538 INFO [org.springframework.web.context.ContextLoader:345] - Root WebApplicationContext: initialization completed in 9837 ms 31-Oct-2017 23:47:15.541 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Error listenerStart 31-Oct-2017 23:47:15.547 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/corp-manage] startup failed due to previous errors log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.XmlWebApplicationContext). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 31-Oct-2017 23:47:15.633 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [corp-manage] 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. 31-Oct-2017 23:47:15.636 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [corp-manage] 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:43)
©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值