使用Spring Boot框架maven项目新建后启动失败, 提示Unregistering JMX-exposed beans on shutdown

来源:互联网 发布:mac在线恢复系统加速 编辑:程序博客网 时间:2024/05/16 09:25

控制台输出信息如下:

2017-07-13 17:23:16.362  INFO 23232 --- [           main] com.jssz.demo1.Demo1Application          : Starting Demo1Application on PP with PID 23232 (W:\WorkSpace\EclipseWorkspace\demo1\target\classes started by Administrator in W:\WorkSpace\EclipseWorkspace\demo1)2017-07-13 17:23:16.367  INFO 23232 --- [           main] com.jssz.demo1.Demo1Application          : No active profile set, falling back to default profiles: default2017-07-13 17:23:16.534  INFO 23232 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@7a36aefa: startup date [Thu Jul 13 17:23:16 CST 2017]; root of context hierarchy2017-07-13 17:23:17.856  INFO 23232 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup2017-07-13 17:23:17.882  INFO 23232 --- [           main] com.jssz.demo1.Demo1Application          : Started Demo1Application in 2.133 seconds (JVM running for 2.865)2017-07-13 17:23:17.883  INFO 23232 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@7a36aefa: startup date [Thu Jul 13 17:23:16 CST 2017]; root of context hierarchy2017-07-13 17:23:17.884  INFO 23232 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
原因是spring boot 框架自集成tomcat,但是未在pom.xml文件中添加tomcat的依赖关系,解决办法如下:

在pom.xml文件中添加如下依赖:

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></dependency>

阅读全文
0 1