Java 部署到Heroku崩溃:错误R10(启动超时)->;Web进程在启动后90秒内绑定到$PORT失败

Java 部署到Heroku崩溃:错误R10(启动超时)->;Web进程在启动后90秒内绑定到$PORT失败,java,spring-boot,heroku,Java,Spring Boot,Heroku,在Heroku中部署springboot应用程序后,出现以下错误: 2019-12-12T19:09:35.340701+00:00 heroku[web.1]: State changed from starting to crashed 2019-12-12T19:09:35.088497+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seco

在Heroku中部署springboot应用程序后,出现以下错误:

2019-12-12T19:09:35.340701+00:00 heroku[web.1]: State changed from starting to crashed
2019-12-12T19:09:35.088497+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2019-12-12T19:09:35.088497+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-12-12T19:09:35.319755+00:00 heroku[web.1]: Process exited with status 137
2019-12-12T19:16:46.351647+00:00 heroku[web.1]: State changed from crashed to starting
2019-12-12T19:16:50.604492+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=35960 $JAVA_OPTS -jar build/libs/*.jar`
因此,我尝试在项目的根文件夹上创建一个Procfile,内容如下:

程序文件:

web: java -Dserver.port=$PORT -jar build/libs/*.jar
我还将这一行添加到application.properties文件中

application.properties:

server.port=${PORT:5000}
然而,它仍然不起作用。 上述错误仍在发生。我该如何解决这个问题?我还缺什么


我正在使用gradle、java11和spring boot。

您能尝试将
server.address=0.0.0.0
添加到您的应用程序中吗?看起来您已正确设置了
端口
很遗憾,它无法正常工作:(您是否可以尝试将
server.address=0.0.0.0
添加到您的应用程序.properties?看起来您已正确设置了
port
,但很遗憾,它无法正常工作。)(