Infinite redirect loop when deploying Java WAR to Heroku via add-on

When my Bamboo build job deploys my Java WAR file to Heroku and I try to access it, Chrome/Firefox etc all end up giving me a redirect loop error:

The webpage at has resulted in too many redirects.

However, when I deploy the exact same Java app via my command line directly to Heroku (git push heroku master), it all works fine.

I realise this probably has something to do with the difference between deploying a pre-built WAR file and having Heroku build the WAR file from its own git repo. The thing is, I don't know what I need to change to get the pre-built WAR to work.

These are the steps I took:

I built and deployed my app following this tutorial: which worked fine and deployed my app without any issues.

I then decided that I wanted to use Bamboo to build and deploy the application, instead of me having to manually push every change to Heroku, so I set up Bamboo with the following tasks:

1. Source Code Checkout from Bitbucket
2. Build WAR via Maven
3. Heroku deploy WAR artifact

This doesn't work, and results in the infinite redirect issue.

1 answer

Ok, looks like this has to do with SSL and my security-constraint definition in my web.xml. I need to do some more investigation on how to get SSL working on Heroku...

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

348 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you