SpringBoot项目启动报Unable to start ServletWebServerApplicationContext due to missing ServletWeb
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
出错原因:
1、启动类上未加@SpringBootApplication注解
2、缺少spring-boot-starter-web依赖,有此依赖却排除了tomcat的依赖
3、使用本地的tomcat,但是没有进行相关配置