当遇到SpringBoot启动错误'Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean'时,通常是由于缺少@SpringBootApplication注解或者SpringBoot的web依赖。本文介绍了这两种情况的发生原因,并提供了通过添加依赖来解决问题的解决方案。
Spring boot启动报错
spring boot启动报错Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean Spring Boot项目中,出现这个错误有两种情况: