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

 更新时间:2022年03月17日 11:25:22   作者:冬生草  
这篇文章主要介绍了spring cloud eureka 服务启动失败的原因解析,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

环境:

 <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垃圾回收jconsole分析

    Java垃圾回收jconsole分析

    这篇文章主要为大家介绍了Java垃圾回收jconsole分析,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2023-07-07
  • Spring AOP AspectJ使用及配置过程解析

    Spring AOP AspectJ使用及配置过程解析

    这篇文章主要介绍了Spring AOP AspectJ使用及配置过程解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2020-01-01
  • Java开发神器Lombok安装与使用详解

    Java开发神器Lombok安装与使用详解

    Lombok的安装分两部分:Idea插件的安装和maven中pom文件的导入,本文重点给大家介绍Java开发神器Lombok安装与使用详解,感兴趣的朋友跟随小编一起看看吧
    2022-02-02
  • Java如何使用SSLContext请求https链接

    Java如何使用SSLContext请求https链接

    这篇文章主要介绍了Java如何使用SSLContext请求https链接问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2024-01-01
  • idea 自动生成类注释和方法注释的实现步骤

    idea 自动生成类注释和方法注释的实现步骤

    这篇文章主要介绍了idea 自动生成类注释和方法注释的实现步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2019-12-12
  • java通过注解翻译字典的实现示例

    java通过注解翻译字典的实现示例

    本文主要介绍了java通过注解翻译字典的实现示例,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-04-04
  • 基于java线程池读取单个SQL数据库表

    基于java线程池读取单个SQL数据库表

    这篇文章主要为大家详细介绍了基于java线程池读取单个SQL数据库表,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2019-08-08
  • java实现OpenGL ES纹理映射的方法

    java实现OpenGL ES纹理映射的方法

    这篇文章主要介绍了java实现OpenGL ES纹理映射的方法,以实例形式较为详细的分析了纹理映射的实现技巧,需要的朋友可以参考下
    2015-06-06
  • Java中Tuple的功能及使用详解

    Java中Tuple的功能及使用详解

    Java中的Tuple是一种非常有用的数据结构,它可以让开发者在处理多个数据元素时更加方便和高效,通过Tuple,我们可以将多个变量打包成一个对象,从而减少了代码量,提高了代码可读性,这篇文章主要介绍了Java中Tuple的功能及使用场景,需要的朋友可以参考下
    2024-01-01
  • 将BigDecimal转成字符串为科学计数法的踩坑记录

    将BigDecimal转成字符串为科学计数法的踩坑记录

    这篇文章主要介绍了将BigDecimal转成字符串为科学计数法的踩坑记录,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-06-06

最新评论