Spring Boot:Unregistering JMX-exposed beans on shutdown

想根据spring boot官网的demo写一个webservice的程序,但是一直报错:Unregistering JMX-exposed beans on shutdown

控制台输出如下:

2018-01-05 16:27:17.681  INFO 6616 --- [           main] hello.Application                        : Starting Application on NH7A716BY4S5KHD with PID 6616 (E:\Dev\workspace-eclipse\testlog\target\classes started by Administrator in E:\Dev\workspace-eclipse\testlog)
2018-01-05 16:27:17.684  INFO 6616 --- [           main] hello.Application                        : No active profile set, falling back to default profiles: default
2018-01-05 16:27:17.742  INFO 6616 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2698dc7: startup date [Fri Jan 05 16:27:17 CST 2018]; root of context hierarchy
2018-01-05 16:27:18.808  INFO 6616 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-01-05 16:27:18.823  INFO 6616 --- [           main] hello.Application                        : Started Application in 1.438 seconds (JVM running for 1.79)
2018-01-05 16:27:18.824  INFO 6616 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2698dc7: startup date [Fri Jan 05 16:27:17 CST 2018]; root of context hierarchy
2018-01-05 16:27:18.825  INFO 6616 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

网上普遍的解决方案是在pom.xml文件添加以下依赖:

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
但是官方文档中有明确说明spring-boot-starter-web默认用的就是tomcat内嵌容器,所以我认为这不是导致问题的原因,不过我还是以试一试的态度加了该依赖,果然没有作用。网上解决方案找了半天,还是没能解决问题。所以我感觉这可能是spring boot的一个bug,于是我以试一试的心态将以下依赖版本,由目前最高版本降到了低一版本,再运行程序,OK
<parent>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-parent</artifactId>
   <version>1.4.7.RELEASE</version>
   <!-- <version>1.5.9.RELEASE</version> -->
</parent>
也就是说1.5.9版本的spring boot可能存在导致该异常的bug,至于到底是不是个bug以及具体导致bug的原因,需要查看源码或者去官方论坛进一步探究

未完待续

//TODO 找到报错的具体原因




  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 12
    评论
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值