记录一次依赖冲突问题

项目使用spring-boot-admin做应用健康监控,初始使用版本2.2.3

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

导致依赖冲突

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

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    de.codecentric.boot.admin.server.services.AbstractEventHandler.start(AbstractEventHandler.java:57)

The following method did not exist:

    reactor.core.publisher.Flux.retryWhen(Ljava/util/function/Function;)Lreactor/core/publisher/Flux;

The calling method's class, de.codecentric.boot.admin.server.services.AbstractEventHandler, was loaded from the following location:

    jar:file:/D:/program/maven/rep/de/codecentric/spring-boot-admin-server/2.2.3/spring-boot-admin-server-2.2.3.jar!/de/codecentric/boot/admin/server/services/AbstractEventHandler.class

The called method's class, reactor.core.publisher.Flux, is available from the following locations:

    jar:file:/D:/program/maven/rep/io/projectreactor/reactor-core/3.4.22/reactor-core-3.4.22.jar!/reactor/core/publisher/Flux.class

The called method's class hierarchy was loaded from the following locations:

    reactor.core.publisher.Flux: file:/D:/program/maven/rep/io/projectreactor/reactor-core/3.4.22/reactor-core-3.4.22.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes de.codecentric.boot.admin.server.services.AbstractEventHandler and reactor.core.publisher.Flux


Process finished with exit code 1

这里的retryWhen方法不存在

	public void start() {
		this.scheduler = this.createScheduler();
		this.subscription = Flux.from(this.publisher).subscribeOn(this.scheduler).log(this.log.getName(), Level.FINEST)
				.doOnSubscribe((s) -> this.log.debug("Subscribed to {} events", this.eventType)).ofType(this.eventType)
				.cast(this.eventType).transform(this::handle).retryWhen(Retry.any().retryMax(Long.MAX_VALUE)
						.doOnRetry((ctx) -> this.log.warn("Unexpected error", ctx.exception())))
				.subscribe();
	}

解决方法下载maven helper插件在这里插入图片描述
检查依赖是否冲突
在这里插入图片描述
发现没有依赖冲突,最后发现是版本太低将版本升高至2.7.5

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

问题解决

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值