HikariPool-1 - Shutdown initiated... HikariPool-1 - Shutdown completed.报错

问题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。

猜你喜欢

转载自blog.csdn.net/VABTC/article/details/112008583
今日推荐