Manu Zi
Manu Zi

Reputation: 2370

Spring Actuator "/actuator" endpoint not available

I created a simple sample project, with only spring-web and spring-actuator. I'm not able to call the /actuator endpoint in this project. Only thing I get is that 404 error:

There was an unexpected error (type=Not Found, status=404). No message available

In the logs I can't see anything about this. I activated the management.security.enabled=false in the application.properties to avoid the security issues.

In other projects with the same spring, spring-web and spring-actuator version I reach the /actuator endpoint but I can't see differences.

Here is a github link to the sample project: https://github.com/ManuZiD/mzd-actuator

Any suggestions would be nice. Thanks in advance.

Upvotes: 2

Views: 3144

Answers (2)

sam
sam

Reputation: 2004

In my case spring-boot-starter-actuator solved the issue. I was using spring-boot-actuator and spring-boot-actuator-autoconfigure but that wasn't working. Note the word starter in the package. That will be the slightest change you need to make it work.

Upvotes: 1

Darren Forsythe
Darren Forsythe

Reputation: 11411

/actuator requires HATEOAS to be on the classpath, which looking at your sample project it's not there, the other actuator endpoints do not require it (or have different conditional dependencies). Have you tried /info to verify that the other endpoints are working as expected?

To activate the /actuator endpoint add

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>

https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html

Upvotes: 10

Related Questions