spring cloud eureka 服务启动失败的原因分析及解决方法


Posted in Java/Android onMarch 17, 2022

环境:

<spring-boot-version>2.3.5.RELEASE</spring-boot-version>
  <spring-cloud-version>Hoxton.SR8</spring-cloud-version>

错误log

Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-03-15 21:56:29.508 ERROR 18232 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at com.imooc.registry.RegistryApp.main(RegistryApp.java:16) ~[classes/:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:440) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:193) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    ... 9 common frames omitted
Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:187) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:126) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
    ... 14 common frames omitted

原因:spring cloud版本有问题,更换为一下版本即可

<spring-cloud-version>Hoxton.SR12</spring-cloud-version>

Spring 官方对应版本地址: (https://start.spring.io/actuator/info)

{
    "git": {
        "branch": "7857199786b4ffba883304a75dfbaac342ffaa51",
        "commit": {
            "id": "7857199",
            "time": "2022-03-15T07:59:46Z"
        }
    },
    "build": {
        "version": "0.0.1-SNAPSHOT",
        "artifact": "start-site",
        "versions": {
            "spring-boot": "2.6.4",
            "initializr": "0.13.0-SNAPSHOT"
        },
        "name": "start.spring.io website",
        "time": "2022-03-15T08:01:37.995Z",
        "group": "io.spring.start"
    },
    "bom-ranges": {
        "azure": {
            "3.2.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",
            "3.5.0": "Spring Boot >=2.4.0.M1 and <2.5.0-M1",
            "3.14.0": "Spring Boot >=2.5.0.M1 and <2.7.0-M1"
        },
        "codecentric-spring-boot-admin": {
            "2.4.3": "Spring Boot >=2.3.0.M1 and <2.5.0-M1",
            "2.5.5": "Spring Boot >=2.5.0.M1 and <2.6.0-M1",
            "2.6.2": "Spring Boot >=2.6.0.M1 and <2.7.0-M1"
        },
        "solace-spring-boot": {
            "1.1.0": "Spring Boot >=2.3.0.M1 and <2.6.0-M1"
        },
        "solace-spring-cloud": {
            "1.1.1": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",
            "2.1.0": "Spring Boot >=2.4.0.M1 and <2.6.0-M1"
        },
        "spring-cloud": {
            "Hoxton.SR12": "Spring Boot >=2.2.0.RELEASE and <2.4.0.M1",
            "2020.0.5": "Spring Boot >=2.4.0.M1 and <2.6.0-M1",
            "2021.0.0-M1": "Spring Boot >=2.6.0-M1 and <2.6.0-M3",
            "2021.0.0-M3": "Spring Boot >=2.6.0-M3 and <2.6.0-RC1",
            "2021.0.0-RC1": "Spring Boot >=2.6.0-RC1 and <2.6.1",
            "2021.0.1": "Spring Boot >=2.6.1 and <2.6.5-SNAPSHOT",
            "2021.0.2-SNAPSHOT": "Spring Boot >=2.6.5-SNAPSHOT and <3.0.0-M1",
            "2022.0.0-M1": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"
        },
        "spring-cloud-gcp": {
            "2.0.8": "Spring Boot >=2.4.0-M1 and <2.6.0-M1",
            "3.1.0": "Spring Boot >=2.6.0-M1 and <2.7.0-M1"
        },
        "spring-cloud-services": {
            "2.3.0.RELEASE": "Spring Boot >=2.3.0.RELEASE and <2.4.0-M1",
            "2.4.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1",
            "3.3.0": "Spring Boot >=2.5.0-M1 and <2.6.0-M1",
            "3.4.0": "Spring Boot >=2.6.0-M1 and <2.7.0-M1"
        },
        "spring-geode": {
            "1.3.12.RELEASE": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",
            "1.4.13": "Spring Boot >=2.4.0-M1 and <2.5.0-M1",
            "1.5.10": "Spring Boot >=2.5.0-M1 and <2.6.0-M1",
            "1.6.4": "Spring Boot >=2.6.0-M1 and <2.7.0-M1",
            "1.7.0-M2": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",
            "2.0.0-M1": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"
        },
        "vaadin": {
            "14.8.5": "Spring Boot >=2.1.0.RELEASE and <2.6.0-M1",
            "23.0.1": "Spring Boot >=2.6.0-M1 and <2.8.0-M1"
        },
        "wavefront": {
            "2.0.2": "Spring Boot >=2.1.0.RELEASE and <2.4.0-M1",
            "2.1.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1",
            "2.2.2": "Spring Boot >=2.5.0-M1 and <2.7.0-M1"
        }
    },
    "dependency-ranges": {
        "native": {
            "0.9.0": "Spring Boot >=2.4.3 and <2.4.4",
            "0.9.1": "Spring Boot >=2.4.4 and <2.4.5",
            "0.9.2": "Spring Boot >=2.4.5 and <2.5.0-M1",
            "0.10.0": "Spring Boot >=2.5.0-M1 and <2.5.2",
            "0.10.1": "Spring Boot >=2.5.2 and <2.5.3",
            "0.10.2": "Spring Boot >=2.5.3 and <2.5.4",
            "0.10.3": "Spring Boot >=2.5.4 and <2.5.5",
            "0.10.4": "Spring Boot >=2.5.5 and <2.5.6",
            "0.10.5": "Spring Boot >=2.5.6 and <2.5.9",
            "0.10.6": "Spring Boot >=2.5.9 and <2.6.0-M1",
            "0.11.0-M1": "Spring Boot >=2.6.0-M1 and <2.6.0-RC1",
            "0.11.0-M2": "Spring Boot >=2.6.0-RC1 and <2.6.0",
            "0.11.0-RC1": "Spring Boot >=2.6.0 and <2.6.1",
            "0.11.0": "Spring Boot >=2.6.1 and <2.6.2",
            "0.11.1": "Spring Boot >=2.6.2 and <2.6.3",
            "0.11.2": "Spring Boot >=2.6.3 and <2.6.4",
            "0.11.3": "Spring Boot >=2.6.4 and <2.6.5-SNAPSHOT",
            "0.11.4-SNAPSHOT": "Spring Boot >=2.6.5-SNAPSHOT and <2.7.0-M1"
        },
        "okta": {
            "1.4.0": "Spring Boot >=2.2.0.RELEASE and <2.4.0-M1",
            "1.5.1": "Spring Boot >=2.4.0-M1 and <2.4.1",
            "2.0.1": "Spring Boot >=2.4.1 and <2.5.0-M1",
            "2.1.5": "Spring Boot >=2.5.0-M1 and <2.7.0-M1"
        },
        "mybatis": {
            "2.1.4": "Spring Boot >=2.1.0.RELEASE and <2.5.0-M1",
            "2.2.2": "Spring Boot >=2.5.0-M1"
        },
        "camel": {
            "3.5.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",
            "3.10.0": "Spring Boot >=2.4.0.M1 and <2.5.0-M1",
            "3.13.0": "Spring Boot >=2.5.0.M1 and <2.6.0-M1",
            "3.15.0": "Spring Boot >=2.6.0.M1 and <2.7.0-M1"
        },
        "picocli": {
            "4.6.3": "Spring Boot >=2.4.0.RELEASE and <3.0.0-M1"
        },
        "open-service-broker": {
            "3.2.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",
            "3.3.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1",
            "3.4.0-M2": "Spring Boot >=2.5.0-M1 and <2.6.0-M1"
        }
    }
}

到此这篇关于spring cloud eureka 服务启动失败的文章就介绍到这了,更多相关spring cloud eureka 启动失败内容请搜索三水点靠木以前的文章或继续浏览下面的相关文章希望大家以后多多支持三水点靠木!

Java/Android 相关文章推荐
总结一些Java常用的加密算法
Jun 11 Java/Android
Spring boot应用启动后首次访问很慢的解决方案
Jun 23 Java/Android
spring项目中切面及AOP的使用方法
Jun 26 Java/Android
解决Swagger2返回map复杂结构不能解析的问题
Jul 02 Java/Android
JavaWeb 入门:Hello Servlet
Jul 16 Java/Android
dubbo集成zipkin获取Traceid的实现
Jul 26 Java/Android
Spring Boot 排除某个类加载注入IOC的操作
Aug 02 Java/Android
JVM的类加载器和双亲委派模式你了解吗
Mar 13 Java/Android
剑指Offer之Java算法习题精讲二叉树的构造和遍历
Mar 21 Java/Android
Java GUI编程菜单组件实例详解
Apr 07 Java/Android
Java实现超大Excel文件解析(XSSF,SXSSF,easyExcel)
Jul 15 Java/Android
Java实现贪吃蛇游戏的示例代码
Sep 23 Java/Android
Java基于Dijkstra算法实现校园导游程序
Java中的随机数Random
Mar 17 #Java/Android
SpringBoot中HttpSessionListener的简单使用方式
Mar 17 #Java/Android
SpringBoot+Redis实现布隆过滤器的示例代码
Mar 17 #Java/Android
Java9新特性对HTTP2协议支持与非阻塞HTTP API
Java练习之潜艇小游戏的实现
Mar 16 #Java/Android
你知道Java Spring的两种事务吗
You might like
php数据结构与算法(PHP描述) 查找与二分法查找
2012/06/21 PHP
php为字符串前后添加指定数量字符的方法
2015/05/04 PHP
PHP中命名空间的使用例子
2019/03/22 PHP
PHP中Static(静态)关键字功能与用法实例分析
2019/04/05 PHP
浅谈PHP中的那些魔术常量
2020/12/02 PHP
form中限制文本字节数js代码
2007/06/10 Javascript
js 动态文字滚动的例子
2011/01/17 Javascript
jQuery判断checkbox是否选中的小例子
2013/12/02 Javascript
JS仿iGoogle自定义首页模块拖拽特效的方法
2015/02/13 Javascript
jQuery实现鼠标滑向当前图片高亮显示并且其它图片变灰的方法
2015/07/27 Javascript
js实现数组冒泡排序、快速排序原理
2016/03/08 Javascript
实践中学习AngularJS表单
2016/03/21 Javascript
jqGrid 学习笔记整理——进阶篇(一 )
2016/04/17 Javascript
Bootstrap Table的使用总结
2016/10/08 Javascript
JS碰撞运动实现方法详解
2016/12/15 Javascript
JS实现异步上传压缩图片
2017/04/22 Javascript
初探js和简单隐藏效果的实例
2017/11/23 Javascript
Vue的elementUI实现自定义主题方法
2018/02/23 Javascript
详解Angular5 路由传参的3种方法
2018/04/28 Javascript
JS+HTML5 Canvas实现简单的写字板功能示例
2018/08/30 Javascript
微信小程序商品详情页底部弹出框
2019/11/22 Javascript
VUE中使用HTTP库Axios方法详解
2020/02/05 Javascript
[03:13]DOTA2-DPC中国联赛1月25日Recap集锦
2021/03/11 DOTA
Python语言的12个基础知识点小结
2014/07/10 Python
Python实现中文数字转换为阿拉伯数字的方法示例
2017/05/26 Python
利用Hyperic调用Python实现进程守护
2018/01/02 Python
python素数筛选法浅析
2018/03/19 Python
python如何对实例属性进行类型检查
2018/03/20 Python
Python实现Dijkstra算法
2018/10/17 Python
python爬取酷狗音乐排行榜
2019/02/20 Python
Python面向对象程序设计类的多态用法详解
2019/04/12 Python
python中xlutils库用法浅析
2020/12/29 Python
python 30行代码实现蚂蚁森林自动偷能量
2021/02/08 Python
文员自我评价怎么写
2013/09/19 职场文书
应届毕业生的个人自我鉴定
2013/10/24 职场文书
2014年手术室工作总结
2014/11/26 职场文书