Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SimpleWebJava应用程序与heroku本地web一起工作,但部署时会崩溃_Java_Web_Heroku_Deployment - Fatal编程技术网

SimpleWebJava应用程序与heroku本地web一起工作,但部署时会崩溃

SimpleWebJava应用程序与heroku本地web一起工作,但部署时会崩溃,java,web,heroku,deployment,Java,Web,Heroku,Deployment,我在我的web java应用程序中使用maven 3和JDK8。当我用heroku本地网站运行它时,它运行得很好。应用程序的部署也很好,但当我尝试访问任何路由时,会收到以下错误消息: 2019-11-16T16:18:12.213730+00:00 heroku[web.1]: State changed from crashed to starting 2019-11-16T16:18:14.828031+00:00 heroku[web.1]: Starting process with c

我在我的web java应用程序中使用maven 3和JDK8。当我用heroku本地网站运行它时,它运行得很好。应用程序的部署也很好,但当我尝试访问任何路由时,会收到以下错误消息:

2019-11-16T16:18:12.213730+00:00 heroku[web.1]: State changed from crashed to starting
2019-11-16T16:18:14.828031+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=5000 -cp target/classes:target/dependency/* Server`
2019-11-16T16:18:16.737715+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2019-11-16T16:18:16.741192+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2019-11-16T16:18:16.852336+00:00 app[web.1]: Servidor à espera de ligações no porto 5000
2019-11-16T16:19:45.407156+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-16T16:19:45.285183+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2019-11-16T16:19:45.285183+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-11-16T16:19:45.382598+00:00 heroku[web.1]: Process exited with status 137
2019-11-16T16:22:20.485432+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sd-back-end.herokuapp.com request_id=6b2ff817-990a-4b10-bd4d-fb2a929ea1fc fwd="149.90.124.74" dyno= connect= service= status=503 bytes= protocol=https
2019-11-16T16:22:20.951050+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sd-back-end.herokuapp.com request_id=894ab47b-a10d-4467-84b3-7ed824b6ff7c fwd="149.90.124.74" dyno= connect= service= status=503 bytes= protocol=https
程序文件:

web: java -Dserver.port=5000 -cp target/classes;target/dependency/* Server

此应用程序的代码:

-Dserver.port=5000
替换为
-Dserver.port=$port

有关更多信息,请参阅