ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
开启springboot的web项目时候,突然报错了 ,一开始是怀疑忘记添加web的依赖了,发现不是;
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.8.RELEASE</version>
</dependency>
后来检查了挺久了,发现自己犯了一个小错误,原来是自己不小心注掉了,@SpringBootApplication 这个注解, 希望大家别犯同样的错误哈,没了这个@SpringBootApplication注解启动web项目的时候,spring容器就创建不出来ServletWebServerApplicationContext 这个类,而且springboot项目也起不来,bug解决,感谢观看。