My actuators in spring boot are not working
My actuators in spring boot are not working
I am trying to check whether my spring boot application is up and running via spring boot actuators. My spring boot application annotation contains this:
@SpringBootApplication(exclude =
DataSourceAutoConfiguration.class,
WebMvcAutoConfiguration.class,
HibernateJpaAutoConfiguration.class EntityManagerFactory
)
In my application properties file I have management.server.port=8081
. But when I start up my application and try to run localhost:8081/actuator/info
I got an error - This site can not be reached.
management.server.port=8081
localhost:8081/actuator/info
What am I doing wrong ?
Thank you for any help.
My spring boot version is 2.0.1.RELEASE.
– User5468622
Sep 18 '18 at 11:25
In your
pom.xml
you have to import the dependency spring-boot-starter-actuator
. Did you have it?– riccardo.cardin
Sep 18 '18 at 11:26
pom.xml
spring-boot-starter-actuator
Yes, I am using gradle - compile("org.springframework.boot:spring-boot-starter-actuator").
– User5468622
Sep 18 '18 at 11:27
If you have server.servlet.context-path configured in your application.properties, then your actuator will be available on localhost:8081context-path/actuator. Also, it should be "actuator" not "actuators"
– sechanakira
Sep 18 '18 at 11:28
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
Which version of Spring boot are you using?
– karen
Sep 18 '18 at 11:22