创建执行器端点时的DataValidationException

时间:2018-02-06 16:30:57

标签: spring maven spring-boot yaml spring-boot-actuator

我在endpoints.yml

中创建了Actuator端点
info:
   '@name@':
   version: '@version@'
   buildNumber: '@buildNumber@'
   buildDate: '@buildDate@'
   buildBranch: '@buildBranch@'

当我尝试执行时,我遇到了一个奇怪的错误:

  

{" errorType":" NOT_FOUND"," entity":null," message":" No message available&# 34;," fieldErrors":null}

在控制台中说

  

c.c.c.errors.BaseControllerAdvice - 抛出了未处理的异常,返回500   org.springframework.data.rest.webmvc.ResourceNotFoundException:找不到资源!

预期输出看起来像

{"${spring":{"application":{"name}":{"version":"@version@","buildNumber":"@buildNumber@","buildDate":"@buildDate@","buildBranch":"@buildBranch@"}}}}

可能导致此错误的原因是什么?

1 个答案:

答案 0 :(得分:0)

我添加了Dependency以启用执行器点,以便了解项目的信息,健康状况,您需要添加的依赖项

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