您当前的位置: 首页 >  ar

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

发布时间:2020-04-26 22:30:23 ,浏览量:0

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即可。
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    115984博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.4453s