【问题标题】:Unable to execute even simple spring boot admin server with spring boot 2.0.0.RELEASE使用 spring boot 2.0.0.RELEASE 甚至无法执行简单的 spring boot 管理服务器
【发布时间】:2018-04-03 13:40:13
【问题描述】:

Pom.xml

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


<dependencies>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-server</artifactId>
    <version>1.5.4</version>
</dependency>

<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-server-ui</artifactId>
    <version>1.5.4</version>
</dependency>

@EnableAdminServer
@SpringBootApplication
public class SpringBootAdminApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootAdminApplication.class, args);
    }
}

当执行 Spring Boot 服务器并给出错误为:任何帮助将不胜感激...

错误 java.lang.NoSuchMethodError:org.springframework.boot.builder.SpringApplicationBuilder.([Ljava/lang/Object;)V

【问题讨论】:

  • 您遇到的错误是什么?
  • 为什么会出现上述错误?虽然 Spring Boot 1.5.8.RELEASE 正在使用 Spring Boot 管理服务器 1.5.4 正常工作和构建
  • 我做了很多研究,也看到了很多像你提到的链接示例。请完全卡住。请帮助...
  • 对 spring-boot-parent 和 admin-ui 使用相同的版本。您在一处使用 2.0.0,在另一处使用 1.5.4

标签: spring-boot spring-boot-admin


【解决方案1】:

Spring Boot Admin 尚不支持 Spring Boot 2.0.0。见:https://github.com/codecentric/spring-boot-admin/issues/668

如果你想使用 spring boot admin 你应该使用旧版本的 spring boot。

【讨论】:

  • 是的,我已经使用 spring boot 1.5.8.RELEASE 实现了 spring boot admin server 1.5.4。但是当我将启动版本更改为 spring boot 2.0.0.RELEASE 时。它显示了上面提到的错误。我怀疑必须对 pom 文件进行一些更改才能使用 spring boot 2 和 spring boot server 1.5.4
猜你喜欢
  • 2018-12-31
  • 1970-01-01
  • 2014-06-18
  • 1970-01-01
  • 2018-03-28
  • 2017-11-10
  • 1970-01-01
  • 2014-04-07
  • 2019-05-29
相关资源
最近更新 更多