java - Heroku Spring Boot 启动

标签 java spring-boot heroku

我尝试在 Heroku 上运行我的 Spring Boot 应用程序。应用程序正确启动,但之后它立即崩溃并出现以下错误:

2019-03-19T11:45:28.343758+00:00 app[web.1]: 2019-03-19 11:45:28.343  INFO 4 --- [           main] main.Application                         : Started Application in 23.503 seconds (JVM running for 24.505)
2019-03-19T11:46:24.818535+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/api/ping/" host=fill-it.herokuapp.com request_id=b6fea897-b436-4918-bc6f-3cde7e4f94aa fwd="5.184.28.91" dyno= connect= service= status=503 bytes= protocol=https
2019-03-19T11:46:32.330719+00:00 heroku[web.1]: State changed from starting to crashed
2019-03-19T11:46:32.173577+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2019-03-19T11:46:32.173731+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-03-19T11:46:32.312711+00:00 heroku[web.1]: Process exited with status 137
2019-03-19T11:46:32.734743+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fill-it.herokuapp.com request_id=5802be29-5937-4d0f-93fb-7a01b4972d9e fwd="5.184.28.91" dyno= connect= service= status=503 bytes= protocol=https
2019-03-19T11:46:33.049778+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/ping/" host=fill-it.herokuapp.com request_id=4c7eff04-ce3a-4a63-b7bf-312b44658e40 fwd="5.184.28.91" dyno= connect= service= status=503 bytes= protocol=https

有人遇到类似问题吗?

最佳答案

确保您的 Procfile 在 java 命令中具有 -Dserver.port=$PORT

关于java - Heroku Spring Boot 启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55240402/

相关文章:

node.js - 将 Heroku 插件 mongolab 与 Node.js 结合使用

ssl - CNAME 记录和 Heroku 域

java - 扩展类中的 Spring Boot @Service 注解

ruby-on-rails - 在生产中使用jquery-ui-rails gem时,Heroku找不到jquery.ui

java - 在 preparedStatement 中使用可变数量的参数

Java - 如何在字符串中的 "\\"或 "("前面添加 ")"

spring-boot - 在引导中启动Spring Security过滤器链之前调用过滤器

hibernate - 如何在使用 spring-boot-jpa 时对 ddl 的编码进行编码

java - 泛型实现 Map.entrySet() 时遇到问题

java - 如何限制Firestore中添加和删除监听器的数量?