简体   繁体   English

构建和部署成功,但是在Spark(Java Framework)的Heroku上没有运行任何Web进程

[英]build and deployment success but no web process running on Heroku on Spark (Java Framework)

I'm getting a no web process error even though the project was built and deployed successfully. 即使成功构建并部署了项目,我也没有遇到任何Web处理错误。 Here's my Procfile to specify how to run my java spark app. 这是我的Procfile,用于指定如何运行Java Spark应用程序。

 java -jar target/simplenlg-0.0.1-SNAPSHOT-jar-with-dependencies.jar 

I've also used foreman start to check to see if it's running and yes it's working. 我还用工头开始检查它是​​否正在运行,是的,它正在工作。

Here's my code that'll determine the port 这是我的代码,它将确定端口

static int getHerokuAssignedPort() {
    ProcessBuilder processBuilder = new ProcessBuilder(); 
    if (processBuilder.environment().get("PORT") != null) {
        return Integer.parseInt(processBuilder.environment().get("PORT"));
    }
    return 4567;
}

I've followed this tutorial but it's still not working for me... 我已按照本教程进行操作,但对我来说仍然无效...

https://sparktutorials.github.io/2015/08/24/spark-heroku.html https://gist.github.com/jesperfj/1222739 https://sparktutorials.github.io/2015/08/24/spark-heroku.html https://gist.github.com/jesperfj/1222739
https://gist.github.com/Fitzsimmons/2490382 https://gist.github.com/Fitzsimmons/2490382

I'm not sure what happened but I followed this No web processes running Error - Deploying Django on Heroku . 我不确定发生了什么,但是我遵循了此步骤。 没有Web进程在Heroku上运行错误部署Django

heroku scale web=1

Then do another mvn heroku:deploy and now it works. 然后执行另一个mvn heroku:deploy,现在可以使用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM