java.lang.IllegalStateException: couldn't determine local port. Please supply service-base-url. how can i solve it? I used spring-boot-admin in spring cloud Finchley.RELEASE version
Either set spring.boot.admin.client.instance.service-base-url. Or just make jar instead of war.
we used spring-boot-admin in spring cloud, what is spring.boot.admin.client.instance.service-base-url? how to set it ,can you supply a example?
the property name was in my comment https://github.com/codecentric/spring-boot-admin/issues/796#issuecomment-399326340
my spring boot application is deployed on a kubernetes (openshift) cluster. i have no way of knowing the service-base url.
when debugging the application startup, it becomes obvious that the application registration event ist fired before the @EventListener. the eventlistener would set the localServerPort needed by the getServiceBaseUrl method.
I reckon this issue has been closed in too much haste....
yes, please reopen.
For a k8s environment i suggest you just include the spring-cloud-kubernetes discovery in the SBA server and get rid of the sba clients.
yes, please reopen.
Before I reopen this issue, please update to a recent version of SBA and provide a sample project to reproduce the issue.
This can happen when you are running your client in separate container. (Tomcat/ server) So client does not know its own port. So it should be configured.
use the following properties (credits : @vishnumanohar7)
spring.boot.admin.client.url=http://localhost:8080/admin-server (admin server url)
spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8080 (application url)
Most helpful comment
my spring boot application is deployed on a kubernetes (openshift) cluster. i have no way of knowing the service-base url.
when debugging the application startup, it becomes obvious that the application registration event ist fired before the @EventListener. the eventlistener would set the localServerPort needed by the getServiceBaseUrl method.