当Springboot应用程序通过应用程序服务器上的Fat Jar文件运行时,无法访问执行器

发布于 2025-02-12 00:52:45 字数 839 浏览 0 评论 0原文

我在这个联赛中有点不合时宜,因为我仍然熟悉Springboot的所有内容。在我的问题上...

我无法访问在应用程序服务器上胖罐子中运行的应用程序的执行器。当我通过Eclipse本地运行应用程序时,一切都很好,因为我能够通过浏览器和邮递员完美地访问几个端点(健康,日志文件)。

但是,当我尝试使用应用程序服务器的URL访问相同的端点(通过Curl,浏览器或Postman)时,我会得到404。我能够在没有问题的情况下访问应用程序中的其他自定义书面API,只是不执行APIS 。

我知道我缺少一些很明显的东西,但无法弄清楚那是什么。

好 - http:// localhost:9091/执行器/健康 - >从浏览器或邮递员

不好-http:// my-app-testServer-01:9090/arecuator/health或curl localhost:9090/cartuator/health,都产生以下错误。请注意,卷曲是在应用程序服务器上执行的。

“ TIMESTAMP”:“ 2022-06-30T20:57:12.191+00:00”,“状态”:404,“错误”:“找不到”,“ path”,“ path”:“/cartuator/health”

还有什么?哦,是的,下面是我的YML文件中与执行器有关的片段,我相信可以。

对此的任何见解将受到极大的赞赏。谢谢。

management:
  server:
    port: 9090
  endpoints:
    web:
      exposure:
        include: "health,info,logfile" ```

I am a little out of my league on this one as I am still getting familiar with everything Springboot. Onto my problem...

I am unable to access actuator for an application that is running in a fat jar file on an application server. All works great when I run the application locally through Eclipse as I am perfectly able to access a couple of the endpoints (health, logfile) via a browser and Postman.

However, when I attempt to access those same endpoints (via curl, a browser or Postman) using the application server's url, I get a 404. I am able to access other custom written apis within the application with no issue, just not actuator apis.

I know I am missing something very obvious, but cannot figure out what that is.

Good - http://localhost:9091/actuator/health --> from a browser or Postman

Not good - http://my-app-testserver-01:9090/actuator/health or curl localhost:9090/actuator/healthand both yield the below error. NOTE that the curl is performed on the application server.

"timestamp":"2022-06-30T20:57:12.191+00:00","status":404,"error":"Not Found","path":"/actuator/health"

What else? Oh yeah, below is a snippet from my yml file pertaining to actuator and I believe that is ok.

Any insight on this is greatly appreciated. Thank you.

management:
  server:
    port: 9090
  endpoints:
    web:
      exposure:
        include: "health,info,logfile" ```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沫尐诺 2025-02-19 00:52:45

这一切都设定了。我正在新服务器上设置应用程序,必须为我打开端口。完成此操作后,我就可以访问无问题的执行器API。

This is all set now. I was setting up the application on a new server and had to have the ports opened up for me. Once that was done I was able to access the Actuator apis with no issues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文