๐Ÿ”ด The Error You're Seeing

Confirm this matches your console output. If it does, you're in the right place.

ERROR LOG2026-02-14 11:45:30.500 WARN 8842 --- [nio-8080-exec-3] o.s.web.servlet.PageNotFound : No mapping for GET /actuator/health

โšก Quick Fix Works 80% of the time

Expose the endpoints in application.properties.

management.endpoints.web.exposure.include=health,info,metrics

๐Ÿ› ๏ธ Solutions (3 Ways to Fix)

Solution 1โœ“ Most common cause

Expose endpoints in application.properties

๐Ÿ‘‰ Use this when you have the dependency installed but the URL returns 404.

For security reasons, Spring Boot only exposes /actuator/health over HTTP by default. You must explicitly allow others.

# application.properties management.endpoints.web.exposure.include=* # OR specific ones: management.endpoints.web.exposure.include=health,info,metrics,prometheus
Solution 2

Add the Actuator dependency

๐Ÿ‘‰ Use this if hitting /actuator gives a 404 for the base path itself.

If the dependency isn't in your pom.xml, the endpoints don't exist at all.

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
Solution 3

Change the base path

๐Ÿ‘‰ Use this if you want the endpoints under a different URL (e.g., /manage/health).

If you configured a custom base path, you must use that instead of /actuator.

# application.properties management.endpoints.web.base-path=/manage // Now the URL is: http://localhost:8080/manage/health

๐Ÿ“‹ Version Notes

Spring Boot 2.x

Default base path is /actuator. /health is exposed by default.

Spring Boot 3.x

Default base path is /actuator. /health is exposed, but without details unless show-details=always is set.

๐Ÿง  Why this Happens

Tap to expand the deep technical explanation

You are trying to access a Spring Boot Actuator endpoint, but either the Actuator dependency is missing, or the specific endpoint (like /metrics or /env) is not explicitly exposed over HTTP in your configuration.

The HITEC City Parking Spot Analogy:

It is like looking for a specific room in a building, but the hallway leading to it is locked. The room exists, but the architect (Spring Boot) locked the hallway for security reasons. You need the key (exposure.include) to open it.

๐Ÿ›ก๏ธ How to Prevent This Next Time

Standardize your Actuator configuration across all microservices early in the project setup.

Course Search
Search across all chapters & stages
๐Ÿ“–

Search the course

Type any topic โ€” branching, stash, rebase, hooks โ€” and jump straight to that chapter.

merge branchesgit stashundo commitrebase