Spring-boot 2.0.0 M1 - Drive not working

I have a Spring-boot project that uses the Spring-boot mechanism to provide application statistics and metrics.

The functionality of the actuator is provided by adding the "spring-boot-starter-actuator" to the project.

Security is disabled at this point, so the project does not import Spring-security.

Using Spring-boot 1.5.x, all actuator endpoints (automatically provided, like / info, and my defined specific endpoints) work correctly.

After upgrading to Spring-boot 2.0.0 M1, the endpoints of the actuator are no longer displayed. The endpoint call / info returns the following error:

{"timestamp":1496948526890,"status":404,"error":"Not Found","message":"No 
message available","path":"/info"}

Note about Tomcat: I override the tomcat.version property to use version 9.

  • When using Spring-boot 1.5.x, tomcat.version = 9.0.0.M9
  • When using Spring-boot 2.0.0.M1, tomcat.version = 9.0.0.M21
+4
source share
4 answers

It looks like the endpoint is no longer displayed on / info

2017-06-08 13:11:57.817 [main] INFO o.s.b.a.e.mvc.EndpointHandlerMapping - Mapped "{[/application/info || /application/info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()

and in accordance with the 2.0.0 / SNAPSHOT documentation this is expected.

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints

Try /application/info

+5
source

And he moved again. Right now, the URL-address of the lives under /actuator, for example /actuator/health.

See https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints

+3
source

, :

management.context-path =

, "/info" , .

+2
source

try it

management: endpoints: web: exposure: include: '*' base-path: /actuator

+1
source

Source: https://habr.com/ru/post/1678816/


All Articles