*Springboot项目启动报错:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
相信刚学的springboot框架的小伙伴们会存在这样的问题 ,今天给大家来解决一下.个人实践,不喜勿喷!
在我刚刚启动springboot项目时,报了一个这样的错误:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
报错信息 就是我用红框圈住的部分。不难理解因为启动时缺少tomcat所导致的 我们需要检查pom配置文件中的sprinfboot引用是否齐全。于是发现少了tomcat配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--<scope>provided</scope>-->
</dependency>
然后将它加入到pom文件中然后重新启动就ok 了出现有端口号就没问题了 希望对小伙伴们有用处。。。