Skip to content
Advertisement

Heroku SprinBoot Deployment is sucess but Status is 503 Service Unavailable

Hi I am trying to deploy a Spring Boot Application to Heroku. The build is a success but when I try to run the app I get a Status 503: Service Unavailable Error.

I referred a similar post Application Error after a successful deployment at Heroku but this didn’t helped me.

Here is my pom.xml

JavaScript

4.0.0 org.springframework.boot spring-boot-starter-parent 2.5.2 com.sample.app sample-app 0.0.1-SNAPSHOT sample-app Sample Project <java.version>11</java.version> jar org.springframework.boot spring-boot-starter-data-jdbc org.springframework.boot spring-boot-starter-web

JavaScript

Here is the error log from heroku logs --tail

JavaScript

Advertisement

Answer

As it turns out the failing logs mentions that a Procfile is needed for Heroku and a Spring Boot Application.

Taken from Spring Docs: To customize Heroku builds, we need to provide a Procfile, which provides the incantation required to deploy an application. Heroku assigns a port for the Java application to use and then ensures that routing to the external URI works.

we must configure our application to listen on the correct port. Here’s the Procfile for a starter REST application:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement