Issue
Your Java application is failing to start within the allotted boot timeout limit. This is either because it is binding to a port (such as 8080) other than the one provided by Heroku via the $PORT
environment variable or because the app takes too long before it binds to this port.
Resolution
First, ensure that your application is binding to the port defined by the $PORT
environment variable. How you do this will depend on the server and framework you are using. See the Dev Center documentation on Setting the HTTP Port for Java Applications for more detailed information.
If you are binding to the correct port, then you may need to reduce the amount of time it takes for your app to boot. The most common way to do this is by moving your database migrations to the Heroku release phase. You can read about how to do this in our Dev Center guide to Running Database Migrations for Java Apps.