在同一个tomcat下部署多个springboot项目时,springboot项目无法正常启动的问题

这个问题是基于,不使用springboot内置的tomcat会产生(即使用自己的tomcat时)。


今天在部署springboot项目的时候遇到了一个问题,怎么部署都访问不了,在网上查了很多原因,什么pom.xml中依赖没加,或者依赖冲突等等 各种原因都试了 ,结果还是访问不了,这就很纳闷了,因为我之前部署过一个springboot项目,也就打包,放一下就完事了,很简单啊,但这次不行,后来去看了tomcat的日志。

日志中的错误如下:

Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [com.alibaba.druid.filter.stat.StatFilter@70258285] with key 'statFilter

在网上找了该错误的解决方案,找到了原因。

需要在第二个、或者第三个springboot项目的application.properties(yml)文件中 加上下面这句配置

spring.jmx.enabled=false


OK,问题解决了。总结一下:日志是个好东西,在解决不了问题的时候,去看看日志,找到问题的根源 总会解决。

原文链接:

https://blog.csdn.net/damionew/article/details/78959950




猜你喜欢

转载自blog.csdn.net/ajklaclk/article/details/80836092
今日推荐