0
点赞
收藏
分享

微信扫一扫

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean解决方案N种

秀妮_5519 2022-03-14 阅读 113


Spring Boot启动应用总是报错如下:

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

与“Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean”如出一辙。

不是技术论坛中大家常说的应用入口类缺少@SpringBootApplication标注,或者是Spring bean缺少@EnableAutoConfiguration标注等问题。

是因为默认使用的嵌入式Tomcat容器无法启动。

解决的办法来了


  1. 删除Maven本地库中有错的tomcat-embed-core,再次构建下载新的tomcat-embed-core,构建错误消失,成功构建完成。
  2. 把嵌入的tomcat注释一下就可以了
  3. 我就是因为排除了嵌入式tomcat,指定本地的tomcat即可。


举报

相关推荐

0 条评论