0

I have created Spring Boot Gradle Application with PostgreSQL database and deployed on heroku

remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/gradle
remote: -----> Gradle app detected
remote: -----> Spring Boot detected
remote: -----> Installing JDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew build -x check
remote:        To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
remote:        Daemon will be stopped at the end of the build
remote:        > Task :compileJava
remote:        > Task :processResources
remote:        > Task :classes
remote:        > Task :bootJarMainClassName
remote:        > Task :bootJar
remote:        > Task :jar
remote:        > Task :assemble
remote:        > Task :build
remote:
remote:        BUILD SUCCESSFUL in 10s
remote:        5 actionable tasks: 5 executed
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote:        Done: 88.2M
remote: -----> Launching...
remote:        Released v31
remote:        https://lawcase.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/lawcase.git
   464da17..2c2db7c  main -> main

App is deployed on heroku with this URL https://lawcase.herokuapp.com, I have developed Rest APIs in my Spring Boot APP, I have also added ProcFile

web: java -jar build/libs/LawCase-0.0.1-SNAPSHOT-plain.jar

but when i tried to hit API using URL with Postman

 https://lawcase.herokuapp.com/getprofiles

I am getting 503 Service Unavailable

here are the heroku logs

    2021-11-09T08:13:26.000000+00:00 app[api]: Build started by user ahmad.sardar@hotmail.com
2021-11-09T08:13:53.069450+00:00 app[api]: Release v30 created by user ahmad.sardar@hotmail.com
2021-11-09T08:13:53.069450+00:00 app[api]: Deploy 464da17a by user ahmad.sardar@hotmail.com
2021-11-09T08:13:56.790716+00:00 heroku[web.1]: State changed from crashed to starting
2021-11-09T08:13:59.975307+00:00 heroku[web.1]: Starting process with command `java -jar build/libs/LawCase-0.0.1-SNAPSHOT-plain.jar`
2021-11-09T08:14:00.808404+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
2021-11-09T08:14:00.883195+00:00 app[web.1]: no main manifest attribute, in build/libs/LawCase-0.0.1-SNAPSHOT-plain.jar
2021-11-09T08:14:01.026544+00:00 heroku[web.1]: Process exited with status 1
2021-11-09T08:14:01.157284+00:00 heroku[web.1]: State changed from starting to crashed
2021-11-09T08:14:01.179061+00:00 heroku[web.1]: State changed from crashed to starting
2021-11-09T08:14:04.663230+00:00 heroku[web.1]: Starting process with command `java -jar build/libs/LawCase-0.0.1-SNAPSHOT-plain.jar`
2021-11-09T08:14:05.581810+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
2021-11-09T08:14:05.645857+00:00 app[web.1]: no main manifest attribute, in build/libs/LawCase-0.0.1-SNAPSHOT-plain.jar
2021-11-09T08:14:05.769007+00:00 heroku[web.1]: Process exited with status 1
2021-11-09T08:14:06.249030+00:00 heroku[web.1]: State changed from starting to crashed
2021-11-09T08:14:07.000000+00:00 app[api]: Build succeeded
2021-11-09T08:14:45.278393+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=lawcase.herokuapp.com request_id=788e94d4-a03c-4df8-a9aa-d1b68cc69c55 fwd="39.45.237.31" dyno= connect= service= status=503 bytes= protocol=https
2021-11-09T08:14:46.771103+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=lawcase.herokuapp.com request_id=35c2d34e-95f2-473c-96f5-b25306390781 fwd="39.45.237.31" dyno= connect= service= status=503 bytes= protocol=https
2021-11-09T08:15:09.157754+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/getprofiles" host=lawcase.herokuapp.com request_id=dfc5e5f1-1ab8-4dd4-9677-c6557e5dae38 fwd="39.45.237.31" dyno= connect= service= status=503 bytes= protocol=https

I have tried different solutions from stackoverflow

Heroku jar deployment of Spring Boot with Maven Application giving code=H10

Heroku error code H10 when Spring Boot app is deployed

Spring Boot on Heroku - H10 "app crash"

How can resolve 503 (Service Unavailable) after GET/POST on Spring Boot and Heroku?

heroku[web.1]: State changed from starting to crashed

But I am unable to solve my problem and my app is not working, could anyone please help how to properly deploy and up my APP on Heroku.

Ahmad
  • 1,462
  • 5
  • 17
  • 40

1 Answers1

0

Answering because I can't comment. A couple thoughts. You may not need a Procfile for a Spring Boot app since there is a built-in web server (unless you want to override something). Also found this similar scenario where it was a postgres driver issue.