[Solved] Druid register MBean error: ERROR [com.alibaba.druid.stat.DruidDataSourceStatManager]

It is normal to run a Tomcat project. When running two Tomcat projects, an exception will be reported.

ERROR [com.alibaba.druid.stat.DruidDataSourceStatManager] – unregister mbean error javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean………

Solution:

Modify catalina.sh under Tomcat: add and set Java at the end_OPTS="Ddruid.registerToSysProperty=true"

This method is effective in personal test. If it is added in other places, it is not guaranteed to be effective

Read More: