問題1:HikariPool-1 - Shutdown initiated... HikariPool-1 - Shutdown completed.程序啓動後立馬關閉
問題背景:搭建好Springboot時出現問題,項目啓動後立即關閉了。問題如下
最後發現是缺少spring-boot-starter-web依賴造成的,在pom文件中如果沒有該依賴,添加該依賴,如下:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
添加該依賴後,同時又會遇到新的問題。
問題2:Caused by: java.lang.ClassNotFoundException: org.springframework.web.filter.FormContentFilter
該原因是引入了spring-web包引起的,刪除即可。
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.8.RELEASE</version>
<scope>compile</scope>
</dependency>
spring-web的作用:spring-web提供了核心的HTTP集成,包括一些便捷的Servlet過濾器,Spring HTTP Invoker,與其他Web框架和HTTP技術集成的基礎架構,例如:Hessian,Burlap。