【发布时间】:2020-09-21 18:39:14
【问题描述】:
我有一个春季批处理项目(使用 Gradle)。我希望项目与 Actuator 集成。
我已将此添加到导入到 gradle
implementation "org.springframework.boot:spring-boot-starter-actuator"
在application.yaml中,我已经添加了
server:
port: 8083
servlet:
context-path: "/test"
现在,当我尝试在本地点击 - http://localhost:8083/test/health 时,出现错误 -
{
"timestamp": "2020-09-21T18:36:42.779+00:00",
"status": 404,
"error": "Not Found",
"message": "",
"path": "/test/health"
}
在浏览器上运行相同的端点时,我看到了这个错误-
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Sep 21 18:45:07 UTC 2020
There was an unexpected error (type=Not Found, status=404).
但是当我点击http://localhost:8083/nikhil/api/boot-appliation 等其他端点时,它可以工作!
有什么我遗漏的建议吗?
谢谢
【问题讨论】:
标签: java spring spring-boot gradle spring-boot-actuator