Spring Boot 请求/actuator/beans 无法访问 返回404

编程入门 行业动态 更新时间:2024-10-24 09:22:02

Spring Boot 请求/actuator/beans <a href=https://www.elefans.com/category/jswz/34/1771361.html style=无法访问 返回404"/>

Spring Boot 请求/actuator/beans 无法访问 返回404

问题复现

在保证项目加入了spring-boot-starter-actuator依赖,并成功启动后。通过浏览器进行访问,返回如下图结果:

问题排查

1. 查看日志


从日志中可以看到基于路径’/actuator’下只暴露了一个端点

2. 访问http://localhost:8080/actuator

  • 确实之开放了health端点

解决方案

  • 打开/actuator的所有端口

下面通过配置来暴露除了/shutdown之外的所有端点,在application.properties中进行如下配置:

management.endpoints.web.exposure.include=*

重启,再次访问/actuator,可以看到除了/shutdown之外的其他所有端点。

再次访问/actuator/beans正常显示所有的bean

引用:如何启用Spring Boot Actuator的所有Endpoints

更多推荐

Spring Boot 请求/actuator/beans 无法访问 返回404

本文发布于:2023-11-15 17:24:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603351.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法访问   Boot   Spring   actuator   beans

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!