项目

一般

简介

spring-boot-starter-actuator兼容问题

邱 京宽4 个月 之前添加

报错日志:

java.lang.IllegalArgumentException: Value must not be null
    at org.springframework.util.Assert.notNull(Assert.java:201) ~[spring-core-5.3.30.jar:5.3.30]
    at org.springframework.boot.actuate.health.Health$Builder.withDetail(Health.java:248) ~[spring-boot-actuator-2.7.17.jar:2.7.17]
    at org.springframework.boot.actuate.redis.RedisHealth.up(RedisHealth.java:37) ~[spring-boot-actuator-2.7.17.jar:2.7.17]
    at org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator.up(RedisReactiveHealthIndicator.java:74) ~[spring-boot-actuator-2.7.17.jar:2.7.17]
    at org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator.lambda$getHealth$4(RedisReactiveHealthIndicator.java:70) ~[spring-boot-actuator-2.7.17.jar:2.7.17]
    at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106) [reactor-core-3.4.33.jar:3.4.33]
    at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.33.jar:3.4.33]
    at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122) [reactor-core-3.4.33.jar:3.4.33]
    at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.33.jar:3.4.33]
    at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250) ~[reactor-core-3.4.33.jar:3.4.33]
    at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.33.jar:3.4.33]
    at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.33.jar:3.4.33]
    at io.lettuce.core.RedisPublisher$ImmediateSubscriber.onNext(RedisPublisher.java:886) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]
    at io.lettuce.core.RedisPublisher$RedisSubscription.onNext(RedisPublisher.java:291) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]
    at io.lettuce.core.RedisPublisher$SubscriptionCommand.doOnComplete(RedisPublisher.java:773) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]
    at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:65) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]
    at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:63) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]
    at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:747) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]
    at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:682) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]
    at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:599) ~[lettuce-core-6.1.10.RELEASE.jar:6.1.10.RELEASE]

 

原因:

org.springframework.boot.actuate.redis类中的 up 方法把key写死了 redis_version 在配置中找不到值所以报错:

 

解决方案:

替换启动文件,替换前备份,替换后用新的启动文件重启:

AMDC版本为 2.1