Spring boot App启动报错 missing ServletWebServerFactory bean

将一个普通Java App应用改写为Java Web App,添加了spring-boot-starter-parent之后,Run as Spring App一致报如下错。

org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

网上找了非常多方法,大部分是在 pom.xml 的dependency处修改。直到最终才发现是因为忘了添加应用启动配置。

即:在启动类定义之上添加  @SpringBootApplication 。

如下链接有所启发:

https://blog.csdn.net/qq_39205129/article/details/99978516

猜你喜欢

转载自blog.csdn.net/figosoar/article/details/111581357