版权声明:本博客为自己总结亦或在网上发现的技术博文的转载。 如果文中有什么错误,欢迎指出。以免更多的人被误导。 邮箱:[email protected] 版权声明:本文为博主原创文章,博客地址:https://blog.csdn.net/ChinaMuZhe,未经博主允许不得转载。 https://blog.csdn.net/ChinaMuZhe/article/details/81985474
报错信息如下:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.9.RELEASE)
2018-08-23 17:53:28.851 INFO 14808 --- [ main] qq.MainStart : Starting MainStart on DESKTOP-PJEFV1I with PID 14808 (D:\workspace\etms\qq\target\classes started by yyb in D:\workspace\etms\qq)
2018-08-23 17:53:28.856 INFO 14808 --- [ main] qq.MainStart : No active profile set, falling back to default profiles: default
2018-08-23 17:53:28.976 INFO 14808 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@27d415d9: startup date [Thu Aug 23 17:53:28 CST 2018]; root of context hierarchy
2018-08-23 17:53:30.081 INFO 14808 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-08-23 17:53:30.103 INFO 14808 --- [ main] qq.MainStart : Started MainStart in 1.729 seconds (JVM running for 2.541)
2018-08-23 17:53:30.104 INFO 14808 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@27d415d9: startup date [Thu Aug 23 17:53:28 CST 2018]; root of context hierarchy
2018-08-23 17:53:30.105 INFO 14808 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
自己尝试后,发现有两种情况会,会导致以上错误。
情况一:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
解决:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
情况二:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
使用了1.5.10版本。官网说1.5.10版本解决了55+bug。但是我本地使用1.5.9启动不会报错(不排除有bug),使用1.5.10启动则会报错Unregistering JMX-exposed beans on shutdown。
解决:
暂时不用1.5.10版本。
(笔者目前没找到1.5.10正确的配置方法,有大牛知道的话请点出啊)