JIeT4uK
JIeT4uK

Reputation: 21

Spring Boot Admin error from Client side in port

everyone!

I have a problem with Spring Boot Admin in Client side:

01-04-2021 23:02:37 [registrationTask1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
java.lang.NoSuchMethodError: org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties.getBasePath()Ljava/lang/String;
    at de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getManagementContextPath(ServletApplicationFactory.java:86)
    at de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getManagementBaseUrl(ServletApplicationFactory.java:77)
    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)

my pom.xml:

<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-starter-client</artifactId>
    <version>2.4.0</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    <version>2.4.0</version>
</dependency>

my application.yaml:

spring.boot.admin:
  client:
    url: http://localhost:8080
    username: admin
    password: admin
    instance:
      metadata:
        user:
          name: ${spring.security.user.name}
          password: ${spring.security.user.password}
---
management:
  endpoints:
    web:
      exposure:
        include: httptrace,loggers,health,info,metrics

Admin-side works perfect. Client-side, when I write "url: http://localhost:8080" has error.

Does anybody know why?

Upvotes: 2

Views: 4489

Answers (2)

Murat
Murat

Reputation: 35

May be your dependency versions of the admin server and admin client are different. And spring-boot-starter-actuator dependency may not be required.

Upvotes: 1

Erik P
Erik P

Reputation: 420

This sounds similar to https://github.com/codecentric/spring-boot-admin/issues/1719

The getBasePath() method (being used by Spring Boot Admin Client 2.4) has been introduced with Spring Boot 2.4, are you sure that Spring Boot 2.4 is used at runtime?

Upvotes: 4

Related Questions