java - 使用Spring Actuator时是否需要添加Spring Web?

标签 java spring maven spring-mvc

我正在尝试将企业 Spring Actuator 加入到我的应用程序中。我在我的 pom.xml 中添加了依赖项:

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
        <version>1.4.2.RELEASE</version>
    </dependency>

但是我在尝试访问 /health 端点时收到 404。在线查看后,我了解到我的 POM 中还需要 spring-boot-starter-web 依赖项。我假设我需要执行器依赖才能让它工作

最佳答案

是的,如果您想通过 HTTP 访问,则需要 web(否则只有 JMX 可用)。

documentation for actuator

“单击依赖项并选择 Spring Web 和 Spring Boot Actuator。”

关于java - 使用Spring Actuator时是否需要添加Spring Web?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44563862/

相关文章:

java - 如何将实体添加到数据库而不在数据库中添加相关实体?

java - 数据库持久化过程中的hibernate嵌套异常

spring - 如何将空字符串作为命令行属性传递给 Spring?

java - 根据 .properties 文件中的属性导入 Spring 配置文件

maven - Gradle下载依赖错误

java - Bean创建异常: autowired dependencies failed with another maven spring project

hibernate - 在哪里可以找到 mavenized hibernate-annotations 3.6.10

java - 我似乎无法通过我的 Android 应用程序连接到远程服务器

java - 客户端线程在联系 RMI 服务器时失败 : java. rmi.UnmarshalException:错误解码返回

java - 无法执行语句; SQL [不适用];约束[空];