
报错信息:
1 | 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,检查入口 Application 文件是否加了 @SpringBootApplication 注解,或者 @SpringBootConfiguration、@EnableAutoConfiguration 两个注解。
2,检查 pom.xml 是否正确添加 web 依赖:
1 | <dependency> |