springboot项目没有报错,然后启动完成后接着就平滑关闭了 日志最后一行打印如下
[extShutdownHook] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@82df6a, started
解决方法: 找到pom.xml文件
找到
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>
将其改为
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dependency>
即可解决这个问题