原创

Spring-Either health or status endpoint must be enabled-健康检查

2023-08-17 11:09:11.956 [registrationTask1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler.handleError:95 - Unexpected error occurred in scheduled task
java.lang.IllegalStateException: Either health or status endpoint must be enabled!
at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getHealthEndpointPath(DefaultApplicationFactory.java:214)
at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getHealthUrl(DefaultApplicationFactory.java:154)
at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.createApplication(DefaultApplicationFactory.java:80)
at de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.register(DefaultApplicationRegistrator.java:56)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
#https://www.5axxw.com/questions/simple/eyn0x9 可能还是这个有效
management:
endpoints:
enabled-by-default: false
spring:
sleuth:
enabled: false
zipkin:
enabled: false
看日志是de.codecentric.boot.admin下的,所以应该排除admin的包,
<dependency>
<groupId>cn.jiangjiesheng.bootstrap</groupId>
<artifactId>cloud-service-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<artifactId>spring-boot-admin-client</artifactId>
<groupId>de.codecentric</groupId>
</exclusion>
<exclusion>
<artifactId>spring-boot-admin-starter-client</artifactId>
<groupId>de.codecentric</groupId>
</exclusion>
</exclusions>
</dependency>
正文到此结束
本文目录