打包后线上运行报错

11:53:10.088 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
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:540)
        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 net.guodulink.mi_message.MiEssageApplication.main(MiEssageApplication.java:31)
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
2020-12-02 11:53:10.094 - ## 网关 ## 启动网关 ## 服务启动异常,退出程序
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) ~[wanshu_report_recv2.jar:?]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) ~[wanshu_report_recv2.jar:?]
        at net.guodulink.mi_message.MiEssageApplication.main(MiEssageApplication.java:31) [wanshu_report_recv2.jar:?]
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) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180) ~[wanshu_report_recv2.jar:?]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:154) ~[wanshu_report_recv2.jar:?]
        ... 8 more

解决方案,使用run as maven install 生成jar包,运行无问题

【sping boot】run as maven install 和buid fat jar打包不一样 后者运行不起来相关推荐

  1. maven install后,java -jar XXXX.jar运行---找不到主类问题 以及 虚拟机中执行jar包后 访问页面出现Java heap space等其他问题

    这是前几天遇到的问题了,当天晚上想写下来来着,后来有事情就一直搁置到现在了. 由于我想将SpringCloud项目都导出jar包在虚拟机上运行,然后本地访问,所以先将SpringCloud中的注册中心 ...

  2. maven install 安装项目问题总结An unknown compilation problem occurred

    maven install 安装项目问题总结 1. 环境 jdk 与项目 jdk 与 开发工具 jdk 保持一致; 2. springBoot项目中不能有多个main方法,必须有一个main方法; 2 ...

  3. Maven教程(3)--Maven导入工程常见问题(编码、MavenArchiver、Lifecycle Mapping、maven install 没有反应)...

    常见错误: 常见错误一:These projects must be migrated to correctly function in this version of MyEclipse 需要修改编 ...

  4. maven springboot 除去指定的jar包_1. Spring Boot概述

    1.1 Spring Boot理解 Spring Boot来简化Spring应用开发,约定大于配置,去繁从简,just run就能创建一个独立的,产品级别的应用 背景 J2EE笨重的开发.繁多的配置. ...

  5. spring boot 使用maven和fat jar/war运行应用程序的对比

    文章目录 简介 Spring Boot Maven Plugin 使用Maven命令来运行应用程序 作为fat jar/war包运行应用程序 详解War文件 详解jar文件 如何选择 使用maven和 ...

  6. 在Sping Boot logback的使用

    在Sping Boot logback的使用: 只需要4步即可完成配置: 1 在application.properties中配置logback.xml # log logging.config=cl ...

  7. IDEA maven install 报错:程序包不存在

    maven install 程序包com.waper.common不存在 原因是: 多模块引用时报错,就是说打包时要依赖com.waper.common common模块被其他的模块引入,maven ...

  8. maven install 报错 source 1.5 中不支持 lambda 表达式

    maven install 报错 source 1.5 中不支持 lambda 表达式 maven-compiler-plugin 在编译的时候如果不指定jdk的版本,会默认使用jdk1.5 所以在编 ...

  9. 解决IDEA中进行maven install报:系统资源不足的问题

    一.背景 最近在idea中使用maven对公司的项目进行install的时候老是出现系统资源不足的问题导致install失败,在网上搜索也没找到很好的答案,自己不断摸索,最终在idea的配置里面找到了 ...

最新文章

  1. ECMAScript 6 未来前景
  2. Git-将已有的项目转换为GIT项目托管到 GITHUB 仓库
  3. 关于SPECjAppServer评测,您应该知道的“故事”
  4. 支付宝支付php代码示例,Laravel使用支付宝进行支付的示例代码
  5. win11用户账户如何取消 windows11取消用户账户的设置方法
  6. 用 Go 语言给 Lua/OpenResty 写扩展
  7. Java知多少(31)static关键字以及Java静态变量和静态方法
  8. MySql中varchar(10)和varchar(100)的区别==以及char的利弊
  9. IT十八掌徐培成第二天笔记
  10. jspSmartUpload上传的路径问题
  11. 宗宁:企业微博品牌榜的新时代意义
  12. Xilinx FPGA下载器(DLC9)的 [Labtoolstcl 44-494] 报错解决方法
  13. 陶哲轩实分析 3.4
  14. html5 今日头条视频播放,今日头条app设置自动播放视频的方法
  15. 汇报工作的六大原则,不然怎么努力也白费
  16. 过滤树形结构数组的方法
  17. Java 三角形求边长和角度
  18. mangle和demangle
  19. 关于二进制的一些运算
  20. 局域网视频通讯-Android APP

热门文章

  1. 获取顺序栈的栈顶元素
  2. 盥洗台的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告
  3. MySQL由身份证衍生出的统计数据
  4. MGN(多粒度网络)模型训练的详细步骤
  5. 读此一席话,胜读十年书:最牛情场职场语录大全
  6. windows如何使用本机电脑远程桌面连接另一台电脑
  7. xarray+cfgrib读取grib文件——报错总结
  8. 国际群发短信平台适用于哪些行业?
  9. win10在此计算机上找不到系统映像,解决Win10系统Windows找不到文件确定是否正确...
  10. 消灭泡泡糖游戏java编程_JAVA面向对象编程课程设计——泡泡堂