com.alibaba.druid:type=DruidDataSourceStat error

The original text of the reference blog is as follows:

Druid is used in the project to manage the database connection pool. There is no problem in the local and test environment, but after the production environment, whenever tomcat is started for the first time, the log does not report an error, but the page always fails to appear, and it is closed after closing. When tomcat, look at the log and find the following error:
ERROR [com.alibaba.druid.stat.DruidDataSourceStatManager] – unregister mbean error
javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat
at com.sun.jmx.interceptor. DefaultMBeanServerInterceptor.getMBean……


I found various methods on the Internet, but they were all vague. After many tests, I finally solved the problem. The method is as follows:
Modify the catalina.sh file in the bin directory of tomcat, in # OS specific support. $ var _must_ be set to either true or false. Add
JAVA_OPTS="-Ddruid.registerToSysProperty=true" between cygwin=false

Reference blog: http://blog.csdn.net/chengsi101/article/details/72627062

The following is the configuration of my catalina.sh, about line 103


After the configuration, the error is still reported.


Here is another blog of mine: http://blog.csdn.net/h996666/article/details/78770214

Accidental is also inevitable to solve this bug

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325731586&siteId=291194637