javaspringspring-bootspring-boot-admin

Can't integrate Spring Boot Admin Server 2 and Spring Boot Admin Client 2 with Spring Boot 2 in a single application


I'm migrating an application from Spring Boot to Spring Boot 2. Previously we had to use Spring Boot Admin Server and Client in a single application (i.e. the application was both a server and a client at the same). That is weird but we have to continue use it the same way at least for now.

At first I decided to make it work using a demo project: https://github.com/dmitrysenkovich/spring_boot_admin_2_not_working

However, I'm getting an error:

ApplicationRegistrator: Failed to register application as Application(name=spring-boot-admin-sample-servlet, managementUrl=http://localhost:8080/actuator, healthUrl=http://localhost:8080/actuator/health, serviceUrl=http://localhost:8080/actuator/admin) at spring-boot-admin ([http://localhost:8080/instances]): 404 null. Further attempts are logged on DEBUG level

Spring Boot version is 2.0.4.RELEASE and Spring Boot Admin Client/Server is 2.0.2.

Hope one can make it work. Thank you in advance!


Solution

  • Johannes Edmeier (the creator of Spring Boot Admin) answered me on GitHub here: https://github.com/codecentric/spring-boot-admin/issues/889.

    If you set the spring.boot.admin.context-path, you also have to include this suffix in the spring.boot.admin.client.url

    It works!