1

I am trying to deploy a spring boot application to heroku. (Also using a JawsDB MySQL addon). After I push to git, and also to heroku (git push heroku mybranch:master), and build is always successful, I always get an error:

at=error code=H14 desc="No web processes running"

I gather this to mean my Procfile is incorrect. The file name is spelled correctly, it has no extension, and I have stated there:

web: java -jar C:/Users/Myname/Documents/Programming/appFolder/target/*.jar

The above line shows up also in heroku.com/resources -> free Dynos. So the Procfile contents do get picked up.

I searched SO and other places, and came across questions like Heroku SprinBoot Deployment is sucess but Status is 503 Service Unavailable and What to write in the Procfile? and others, but did not find a final and practical answer to my question.

My question is:

1.Which jar am I directing Heroku to? Heroku itself builds the jar, and it does not appear in my appFolder/target. Just some old jar I once manually built through the 'package' command in eclipse. That's also why I wrote *.jar... (in my desperation,) I want him to collect any jar he finds, since I really don't know what the name of it is supposed to be...

And then what would the correct pattern be (back- or forward-slashes? start from C:/?)

And to help me understand the background better:

  1. Am I supposed to build the jar myself? And if so, what good does Heroku's build do?

  2. Where is Heroku's jar stored, if I want to access it?

Thanks in advance.

  • 1
    I think the ProcFile is fine otherwise it wouldn't build and deploy. You can try to scale up the Dyno `heroku ps:scale web=1 -a APP_NAME`, also check out https://github.com/gcatanese/JavaHerokuProcfile – Beppe C Nov 21 '21 at 12:07
  • @BeppeC I think that scaling definitely changed something. Now instead of the 'heroku ps' command giving 'no Dynos' it gives 'web.1: crashed 2021/11/21 14:49:44 +0200 (~ 8s ago)'. Any input would be appreciated. – SpringIntoJava Nov 21 '21 at 12:51
  • I still remain with the question: Why does heroku build the file and where does it store it? Because it seems like I still need to refer to my locally-built jar file. – SpringIntoJava Nov 21 '21 at 13:02
  • @BeppeC please add your scaling suggestion as an answer so that I can accept it, because that was basically the solution (and the path in the Procfile was target/jarName.jar where I made my own jar) – SpringIntoJava Nov 21 '21 at 13:11

1 Answers1

0

You can scale up the Dyno formation

heroku ps:scale web=1 -a APP_NAME

Don't use the local path of the jar file but instead the path relative to the project as you push to Heroku:

web: java -Dserver.port=$PORT -jar target/jarName.jar
Beppe C
  • 11,256
  • 2
  • 19
  • 41