当前位置:首页 » 《资源分享》 » 正文

程序启动报错org.springframework.context.ApplicationContextException: Unable to start web server

8 人参与  2024年04月04日 16:45  分类 : 《资源分享》  评论

点击全文阅读


目录

一、场景二、报错信息三、原因四、解决


一、场景

1、该项目在Linux和本机电脑上启动都正常

2、在另一台电脑上启动就报错

3、代码都是同一份,没有差别


二、报错信息

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.at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:157)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)at com.xxx.RobotManagerSvr.main(RobotManagerSvr.java:32)Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:206)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:154)... 8 common frames omitted

三、原因

导入spring-boot-starter-tomcat依赖时定义的scope导致

原依赖导入配置

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId>    <!--是provided导致--><scope>provided</scope></dependency>

四、解决

调整后依赖导入配置

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId>    <!--测试时先注释该配置--><!--<scope>provided</scope>--></dependency>

注:本机就算是provided也能正常启动,另一台电脑上就不行,应该是运行环境上的差异


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/90545.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新文章

  • 苏玉柔小说全篇完整在线阅读(疯批霸总?她玉软花柔才没训我!)热门章节列表
  • 重回高温末世,笑看男友的小青梅用唯一的水源洗澡洗头结局_张峻豪田思涵青梅全集_小说后续在线阅读_无删减免费完结_
  • 沈易烟小说(重生嫡女:爱妃马甲又掉啦)章节目录+起点章节(沈易烟)全篇清爽版在线
  • 热文推荐沈棠眠宋闻璟折寒枝簪起霜思小说大结局(折寒枝簪起霜思)书荒必看列表
  • 我的爱,逾期不候(沈书言江映月)全书免费_(沈书言江映月)我的爱,逾期不候后续(沈书言江映月)
  • 婆婆住豪宅开豪车,却直播卖惨说我逼她睡桥洞全书沈威许静在线
  • 情深错付,在回忆里溺亡林小满江叙白_情深错付,在回忆里溺亡林小满江叙白
  • 未婚驸马表妹骑马撞我驴,我直接取消赐婚知乎热门_王法赵大人火麒麟超长版_小说后续在线阅读_无删减免费完结_
  • 老婆将我价值千万的游艇,送给了她的男助理知乎热门_妹妹林以棠念念后续_小说后续在线阅读_无删减免费完结_
  • 家宴过后,我捉奸了庶妹和我老公后续+番外_庶妹老公侍卫读者推荐_小说后续在线阅读_无删减免费完结_
  • 首富老公为三姐妹点天灯挥金如土,我换嫁贺总轰动全国强推_胥淮岁岁过敏最新阅读_小说后续在线阅读_无删减免费完结_
  • 未婚夫和同事孕期领证,我转身嫁入豪门推荐_沈泽光安南拿泽光小编推荐_小说后续在线阅读_无删减免费完结_

    关于我们 | 我要投稿 | 免责申明

    Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1