Spring Boot Admin Server 搭建过程中报错记录

今天尝试项目里面加入Spring Boot Admin,它是一个Web应用程序,用于管理和监视Spring Boot应用程序。它分为Server端和Client端,每个应用程序都被视为客户端并注册到管理服务器。实现的原理则是基于Spring Boot Actuator提供的端点。

搭建admin-server

1.pom文件引入相关依赖

<!-- 添加admin-server、admin-server-ui依赖 -->
<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-server</artifactId>
    <version>2.0.1</version>
</dependency>
<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-server-ui</artifactId>
    <version>2.0.1</version>
</dependency>

2.启动类添加注解@EnableAdminServer

3.启动服务出现下面错误信息

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method reactor.retry.Retry.retryMax(I)Lreactor/retry/Retry; but it does not exist. Its class, reactor.retry.Retry, is available from the following locations:

    jar:file:/D:/mymaven/repository/io/projectreactor/addons/reactor-extra/3.2.0.RELEASE/reactor-extra-3.2.0.RELEASE.jar!/reactor/retry/Retry.class

It was loaded from the following location:

    file:/D:/mymaven/repository/io/projectreactor/addons/reactor-extra/3.2.0.RELEASE/reactor-extra-3.2.0.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of reactor.retry.Retry

项目没能启动就报错,查看错误信息。大概意思:“尝试调用方法reator . retry.retry.retrymax (I)Lreactor/retry/ retry;但它并不存在。它的类,reactor.retry。重试,可在以下地点下载:下面就是两个下载地址”。上网查找相关报错信息发现根本原因就是pom.xml文件中版本依赖有问题。查看我spring boot版本信息:2.1.0.RELEASE,于是将spring-boot-admin-server也升级版本

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

再次启动成功,特此记录!

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot Admin 是一个开源的管理工具,可以用来监控和管理 Spring Boot 应用程序,提供了一系列功能,如应用程序的状态监控、堆栈跟踪、日志级别控制等。下面是搭建 Spring Boot Admin 的步骤: 1. 在 pom.xml 文件添加以下依赖: ```xml <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-server</artifactId> <version>2.3.1</version> </dependency> ``` 2. 在启动类上添加注解@EnableAdminServer: ```java @SpringBootApplication @EnableAdminServer public class SpringBootAdminApplication { public static void main(String[] args) { SpringApplication.run(SpringBootAdminApplication.class, args); } } ``` 3. 配置被监控的应用程序,在被监控的应用程序的 pom.xml 文件添加以下依赖: ```xml <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> <version>2.3.1</version> </dependency> ``` 4. 在被监控的应用程序的配置文件添加以下配置: ```yaml spring.boot.admin.client.url: http://localhost:8080 spring.boot.admin.client.username: admin spring.boot.admin.client.password: admin ``` 其,`spring.boot.admin.client.url` 指向 Spring Boot Admin 服务器的地址,`spring.boot.admin.client.username` 和 `spring.boot.admin.client.password` 是访问 Spring Boot Admin 服务器的用户名和密码。 5. 启动 Spring Boot Admin 服务器和被监控的应用程序,访问 http://localhost:8080 即可查看被监控的应用程序的状态信息。 以上就是搭建 Spring Boot Admin 的简单步骤,希望能对你有所帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值