Springboot启动报错’javax.management.MBeanServer’ that could not be found.

  • A+
所属分类:SpringBoot

springboot启动报错

 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method endpointObjectNameFactory in org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration required a bean of type 'javax.management.MBeanServer' that could not be found.

Action:

Consider defining a bean of type 'javax.management.MBeanServer' in your configuration.

网上试了很多方法都不能解决问题,比如加上配置:spring.jmx.enabled=true,比如加上配置:management.endpoints.jmx.exposure.exclude=*

而且很奇怪的一点是我明明配置的是spring.jmx.enabled=false,我看了JmxEndpointAutoConfiguration这个类生效的条件是spring.jmx.enabled=true,不知道为啥会生效?

Springboot启动报错'javax.management.MBeanServer' that could not be found.

最后试了很多方法,用以下方法解决:

在Springboot启动类上排除掉JmxEndpointAutoConfiguration即可。

exclude = JmxEndpointAutoConfiguration.class
ZPY

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: