同一个Tomcat部署多个springboot项目问题
Posted jiathis
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了同一个Tomcat部署多个springboot项目问题相关的知识,希望对你有一定的参考价值。
2018-12-13 10:37:21,412 ERROR [localhost-startStop-2] c.a.d.s.DruidDataSourceStatManager [DruidDataSourceStatManager.java : 211] unregister mbean error javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:427) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:415) at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:546) at com.alibaba.druid.stat.DruidDataSourceStatManager.removeDataSource(DruidDataSourceStatManager.java:209) at com.alibaba.druid.pool.DruidDataSource$2.run(DruidDataSource.java:1853) at java.security.AccessController.doPrivileged(Native Method) at com.alibaba.druid.pool.DruidDataSource.unregisterMbean(DruidDataSource.java:1849) at com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1808) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)
出现上述问题只要
在 application.properties 中添加 spring.jmx.default-domain=唯一名称(两个项目名字不一样就可以)
以上是关于同一个Tomcat部署多个springboot项目问题的主要内容,如果未能解决你的问题,请参考以下文章
Tomcat 部署多个SpringBoot 项目:ERROR org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter
一个Tomcat下部署多个项目异常:org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register