Spring Boot Application Not Initiating in Heroku

Asked

Viewed 1,097 times

1

I have the following open source application: people-on-map-site.

And I have a Heroku account and this project integrated with the Github repository.

However when doing Deploy appears these messages in the logs:

The build is apparently OK, but in the application log it says that there is no web process.

Heroku ps --app people-on-map-site

Console:

web (Free): java $JAVA_OPTS -Dserver.port=$PORT -jar target/*.jar (1)
web.1: crashed 2016/12/10 18:30:59 -0200 (~ 34s ago)

Application logs:

2016-12-10T20:18:35.789513+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=people-on-map-site.herokuapp.com request_id=0b7e3144-7b77-4e58-bd82-70f2df30e394 fwd="52.5.98.73" dyno= connect= service= status=503 bytes=

2016-12-10T20:18:39.926113+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=people-on-map-site.herokuapp.com request_id=98482863-aa92-4fe0-a205-9c870bdec801 fwd="191.251.40.115" dyno= connect= service= status=503 bytes=

2016-12-10T20:19:50.284079+00:00 heroku[slug-compiler]: Slug compilation started

2016-12-10T20:19:50.284088+00:00 heroku[slug-compiler]: Slug compilation finished

2016-12-10T20:19:50.382287+00:00 heroku[web.1]: State changed from crashed to starting

2016-12-10T20:19:56.323397+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -Dserver.port=14774 -jar target/*.jar`

2016-12-10T20:19:57.707591+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.

2016-12-10T20:19:57.708535+00:00 app[web.1]: Error: Unable to access jarfile target/*.jar

2016-12-10T20:19:57.764190+00:00 heroku[web.1]: State changed from starting to crashed

2016-12-10T20:19:57.752154+00:00 heroku[web.1]: Process exited with status 1

2016-12-10T20:19:58.900035+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=people-on-map-site.herokuapp.com request_id=cb985900-e298-459b-bc98-d6c7059035fc fwd="191.251.40.115" dyno= connect= service= status=503 bytes=

Build log:

-----> Java app detected

-----> Installing OpenJDK 1.8... done

-----> Executing: ./mvnw -B -DskipTests clean dependency:list install

       [INFO] Scanning for projects...

       [INFO]                                                                         

       [INFO] ------------------------------------------------------------------------

       [INFO] Building people-on-map-site 0.0.1-SNAPSHOT

       [INFO] ------------------------------------------------------------------------

       [INFO] 

       [INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ people-on-map-site ---

       [INFO] 

       [INFO] --- maven-dependency-plugin:2.10:list (default-cli) @ people-on-map-site ---

       [INFO] 

       [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ people-on-map-site ---

       [INFO] Using 'UTF-8' encoding to copy filtered resources.

       [INFO] Copying 1 resource

       [INFO] Copying 2 resources

       [INFO] 

       [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ people-on-map-site ---

       [INFO] Changes detected - recompiling the module!

       [INFO] Compiling 3 source files to /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/target/classes

       [INFO] 

       [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ people-on-map-site ---

       [INFO] Using 'UTF-8' encoding to copy filtered resources.

       [INFO] skip non existing resourceDirectory /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/src/test/resources

       [INFO] 

       [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ people-on-map-site ---

       [INFO] Changes detected - recompiling the module!

       [INFO] Compiling 2 source files to /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/target/test-classes

       [INFO] 

       [INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ people-on-map-site ---

       [INFO] Tests are skipped.

       [INFO] 

       [INFO] --- maven-war-plugin:2.6:war (default-war) @ people-on-map-site ---

       [INFO] Packaging webapp

       [INFO] Assembling webapp [people-on-map-site] in [/tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/target/people-on-map-site-0.0.1-SNAPSHOT]

       [INFO] Processing war project

       [INFO] Webapp assembled in [149 msecs]

       [INFO] Building war: /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/target/people-on-map-site-0.0.1-SNAPSHOT.war

       [INFO] 

       [INFO] --- spring-boot-maven-plugin:1.4.2.RELEASE:repackage (default) @ people-on-map-site ---

       [INFO] Replacing main artifact /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/target/people-on-map-site-0.0.1-SNAPSHOT.war to /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/target/people-on-map-site.war

       [INFO] 

       [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ people-on-map-site ---

       [INFO] Installing /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/target/people-on-map-site.war to /app/tmp/cache/.m2/repository/br/com/peopleonmapsite/people-on-map-site/0.0.1-SNAPSHOT/people-on-map-site-0.0.1-SNAPSHOT.war

       [INFO] Installing /tmp/build_e65d2bcd585ed17a976abad81ea368c2/PeopleOnMap-people-on-map-site-3ba8767/pom.xml to /app/tmp/cache/.m2/repository/br/com/peopleonmapsite/people-on-map-site/0.0.1-SNAPSHOT/people-on-map-site-0.0.1-SNAPSHOT.pom

       [INFO] ------------------------------------------------------------------------

       [INFO] BUILD SUCCESS

       [INFO] ------------------------------------------------------------------------

       [INFO] Total time: 8.040 s

       [INFO] Finished at: 2016-12-10T20:11:41+00:00

       [INFO] Final Memory: 49M/310M

       [INFO] ------------------------------------------------------------------------

-----> Discovering process types

       Procfile declares types -> web

-----> Compressing...

       Done: 155.9M

-----> Launching...

       Released v16

       https://people-on-map-site.herokuapp.com/ deployed to Heroku

1 answer

2

Answer:

I created the file Procfile at the root of the project with the following content:

web: java -jar -Dserver.port=$PORT target/people-on-map-site.War

I pulled into the repository and gave the command deploy on Heroku. Then I executed the following command on the terminal to raise a Dyno and consequently the application:

Heroku ps:Scale web=1 --app people-on-map-site

Browser other questions tagged

You are not signed in. Login or sign up in order to post.