Heroku中的REST API返回404,但在本地Tomcat 200中没有问题,没有适当的响应内容

发布于 2025-02-13 07:14:47 字数 1122 浏览 0 评论 0原文

我已经用泽西岛服务建造了Java后端, 我可以使用前端JavaScript从中获取。

当我在Tomcat上本地运行时,我没有任何问题。

发布http:// localhost:8080/restservices/authentication/ 响应是一个工作的jwtoken。

当我尝试在Heroku上进行HOS时,我不断得到404回应,说找不到它。

发布https://archive-trawler.herokuapp.com/restservices/authentication/

Type Status Report
HTTP Status 404 – Not Found

Message The requested resource [/restservices/authentication/] is not available
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.52

我今天在构建日志中注意到了这一点:

-----> Building on the Heroku-20 stack

-----> Determining which buildpack to use for this app

 !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.

            Detected buildpacks: Java,Node.js

            See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order

因此,我猜构建式包装是相关的。但这超出了我迄今为止的知识。

I have built a Java Backend with Jersey services,
Which I can fetch from with a front end javascript.

When I run it locally on tomcat I have no issues;

POST http://localhost:8080/restservices/authentication/
with the response being a working JWToken.

Whereas wheN I try to hos this on heroku, I keep getting a 404 response saying it cannot find it.

POST https://archive-trawler.herokuapp.com/restservices/authentication/

Type Status Report
HTTP Status 404 – Not Found

Message The requested resource [/restservices/authentication/] is not available
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.52

I noticed this in the build logs today:

-----> Building on the Heroku-20 stack

-----> Determining which buildpack to use for this app

 !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.

            Detected buildpacks: Java,Node.js

            See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order

So I am guessing the buildpacks are related. But this surpasses my knowledge by far.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文