Heroku中的REST API返回404,但在本地Tomcat 200中没有问题,没有适当的响应内容
我已经用泽西岛服务建造了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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论