• Springcloud Eureka 启动失败:ERROR org.springframework.boot.SpringApplication


    在测试Euruka作为服务注册中心的时候碰到了这个问题

    [main] ERROR org.springframework.boot.SpringApplication - Application run failed
    java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:157) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:358) at org.springframework.boot.SpringApplication.run(SpringApplication.java:317) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:137) at com.example.demo.EurekaServerApplication.main(EurekaServerApplication.java:12)

    其根本原因是依赖包的版本冲突,错误pom.xml文件如下

    <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.0.2.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>

    修改为

    <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>1.4.0.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>

    再启动就正常了

  • 相关阅读:
    【UR #5】怎样跑得更快 神秘做法
    NOIWC 2022 漂流
    Layui表格,序号列自动产生序号
    DW错误之MARGIN以及其解决办法
    Vue3 vmodel自定义修饰符
    【读书笔记】风控大数据时代下的信贷风险管理和实践
    学习如何学习
    final、finally、finalize 有什么区别?
    java 中都有哪些引用类型?
    Java中二叉树的前序遍历、中序遍历及后续遍历代码
  • 原文地址:https://www.cnblogs.com/zwdx/p/9115272.html
Copyright © 2020-2023  润新知