在Heroku中使用Spring Boot部署Java Project时会遇到H10错误
我一直在尝试部署用Maven和Spring Boot制造的API项目。问题是我的项目完成了部署,但是检查时说:
应用程序错误
应用程序中发生了错误,您的页面不可能是 服务。如果您是应用程序所有者,请检查您的日志以获取详细信息。 您可以使用Heroku CLI使用命令Heroku Logs来执行此操作 -tail
当我检查日志时,我会经常得到
2022-06-04T07:53:42.612557+00:00 heroku[web.1]: Process exited with status 1
2022-06-04T07:53:42.933192+00:00 heroku[web.1]: State changed from starting to crashed
2022-06-04T07:53:43.000000+00:00 app[api]: Build succeeded
2022-06-04T07:53:45.626918+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=nutricare-api.herokuapp.com request_id=e21b99c6-4dbe-4b96-a594-88e6c7ac9a0b fwd="190.237.24.24" dyno= connect= service= status=503 bytes= protocol=https
2022-06-04T07:53:45.928115+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=nutricare-api.herokuapp.com request_id=21bf6abb-e4b3-4e42-b499-e07fa850ae58 fwd="190.237.24.24" dyno= connect= service= status=503 bytes= protocol=https
这是存储库: https:// https:// github .com/eral23/back-End-nutricare ,如果有人可以更深入地检查仓库,我将永远感激不尽,因为我已经在解决方案上挣扎了很多天,而没有任何成功。
I've been trying to deploy a API project made with Maven and Spring Boot. The issue is that my project gets the deploy done, but when checking it says:
Application error
An error occurred in the application and your page could not be
served. If you are the application owner, check your logs for details.
You can do this from the Heroku CLI with the command heroku logs
--tail
When I check the log, I constantly get
2022-06-04T07:53:42.612557+00:00 heroku[web.1]: Process exited with status 1
2022-06-04T07:53:42.933192+00:00 heroku[web.1]: State changed from starting to crashed
2022-06-04T07:53:43.000000+00:00 app[api]: Build succeeded
2022-06-04T07:53:45.626918+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=nutricare-api.herokuapp.com request_id=e21b99c6-4dbe-4b96-a594-88e6c7ac9a0b fwd="190.237.24.24" dyno= connect= service= status=503 bytes= protocol=https
2022-06-04T07:53:45.928115+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=nutricare-api.herokuapp.com request_id=21bf6abb-e4b3-4e42-b499-e07fa850ae58 fwd="190.237.24.24" dyno= connect= service= status=503 bytes= protocol=https
This is the repository: https://github.com/eral23/back-end-nutricare, if someone could check the repo in a deeper way, I'd be eternally grateful because I've been struggling with the solution for many days without any success.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您不必为应用程序设置端口。您需要绑定本地端口,默认情况下为Spring Boot的8080。
因此,要解决此问题,您需要绑定需要添加应用程序的端口。
server.port = $ {端口:8080}
Look like you don't have to set your port for the application. You need to bind your local port which is by default 8080 for spring boot.
So to fix this you need to bind the port for that need to add application.properties to your project with the below property to the file.
server.port=${PORT:8080}