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

问题复现

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

问题排查

1. 查看日志

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

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

  • 确实之开放了health端点

解决方案

  • 打开/actuator的所有端口

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

java 复制代码
management.endpoints.web.exposure.include=*

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

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

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

相关推荐
a8a302几秒前
Laravel9.x新特性全解析
运维·spring boot·nginx
安德鲁20224 分钟前
Spring Boot + Undertow 全栈架构深度剖析时序图
后端
码事漫谈5 分钟前
AI 正在重塑职场:有人乘风破浪,有人悄然掉队
后端
用户974369707252828 分钟前
5分钟搭建企业级实时消息推送系统
后端·websocket
counting money29 分钟前
Spring框架基础(配置篇)
java·后端·spring
生活真难35 分钟前
SpringCloud - 任务调度 - xxl-job
后端·spring·spring cloud
秋91 小时前
OceanBase与GreatSQL在Java应用中的性能调优方法有哪些?
java·开发语言·oceanbase
今天又在写代码1 小时前
并发问题解决
java·开发语言·数据库
老王以为1 小时前
前端视角下的 Java
java·javascript·程序员