Springboot 启动时报错:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerF

Myth丶恋晨 2022-11-17 10:20 380阅读 0赞

Springboot 启动时报错:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

报错原因

ServletWebServerFactory 引用jar包出错

解决:

去掉 javax-servlet 的依赖

  1. <!--<dependency>-->
  2. <!--<groupId>javax.servlet</groupId>-->
  3. <!--<artifactId>javax.servlet-api</artifactId>-->
  4. <!--</dependency>-->

增加tomcat依赖

  1. <dependency>
  2. <groupId>org.apache.tomcat.embed</groupId>
  3. <artifactId>tomcat-embed-core</artifactId>
  4. <version>8.5.34</version>
  5. </dependency>

问题解决


写在最后

天下英雄出我辈,一入江湖岁月催
我是「无间行者」,努力把实践过的解决方案分享给大家
如果这篇文章对你有用,一个赞、一个评论、一个关注,我都很开心
码字不易,给点鼓励吧,让我知道你在看

发表评论

表情:
评论列表 (有 0 条评论,380人围观)

还没有评论,来说两句吧...

相关阅读