Failed to unregister the JMX name: org.apache.commons.dbcp2:name=xxx,type=BasicDataSource

Posted bnbxf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Failed to unregister the JMX name: org.apache.commons.dbcp2:name=xxx,type=BasicDataSource相关的知识,希望对你有一定的参考价值。

 把datesource的bean的class由

org.apache.commons.dbcp2.BasicDataSource

改成 

org.apache.tomcat.dbcp.dbcp.BasicDataSource
并引入相应的jar包
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>7.0.47</version>
</dependency>
最好在bean加上destroy-method="close"
即可解决问题。





以上是关于Failed to unregister the JMX name: org.apache.commons.dbcp2:name=xxx,type=BasicDataSource的主要内容,如果未能解决你的问题,请参考以下文章

Failed to unregister the JMX name: org.apache.commons.dbcp2:name=xxx,type=BasicDataSource

解决failed to unregister JDBC driver导致可能内存泄露的问题

Tomcat出现To prevent a memory leak, the JDBC Driver has been forcibly unregistered.问题的一种情况记录

libvirt error: Failed to reconnect to the hypervisor

error: failed to connect to the hypervisor error: Failed to connect socket to '/var/run/libvirt/

process launch failed : failed to get the task for process xxx