手机版 欢迎访问it开发者社区(www.mfbz.cn)网站

当前位置: > 开发

SpringBoot启动失败:出现错误——HikariPool-1 - Shutdown initiated...后立即出现 HikariPool-1 - Shutdown completed.

时间:2021/4/12 10:30:35|来源:|点击: 次

问题:


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.3.5.RELEASE)

2021-04-12 10:08:16.432  INFO 12728 --- [           main] c.b.m.s.p.PaginationApplication          : Starting PaginationApplication on LAPTOP-J3Q53C5V with PID 12728 (C:\Users\Documents\毕设\study\mybatis-plus-samples\mybatis-plus-sample-pagination\target\classes started by mahao in C:\Users\)
2021-04-12 10:08:16.432 DEBUG 12728 --- [           main] c.b.m.s.p.PaginationApplication          : Running with Spring Boot v2.3.5.RELEASE, Spring v5.2.10.RELEASE
2021-04-12 10:08:16.432  INFO 12728 --- [           main] c.b.m.s.p.PaginationApplication          : No active profile set, falling back to default profiles: default
2021-04-12 10:08:17.097  INFO 12728 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2021-04-12 10:08:17.191  INFO 12728 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
     /               |         
                        3.4.1 
2021-04-12 10:08:17.870  INFO 12728 --- [           main] c.b.m.s.p.PaginationApplication          : Started PaginationApplication in 1.971 seconds (JVM running for 2.675)
2021-04-12 10:08:17.886  INFO 12728 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2021-04-12 10:08:17.886  INFO 12728 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

原因分析:

缺少spring-boot-starter-web依赖

解决:

添加spring-web的启动依赖

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

正确启动控制台显示:

 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
     /               |         
                        3.4.1 
2021-04-12 10:26:57.810  INFO 16780 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-04-12 10:26:57.944  INFO 16780 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-04-12 10:26:57.955  INFO 16780 --- [           main] c.b.m.s.p.PaginationApplication          : Started PaginationApplication in 2.136 seconds (JVM running for 2.941)

 

Copyright © 2002-2019 某某自媒体运营 版权所有