Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix java.net.BindException with Proximo on Heroku?

I have installed the Proximo add-on on Heroku and when prepending the command to my existing command, I get a BindException from Java. This is how my prepended command looks: web: bin/proximo sh target/bin/webapp and as soon as I remove the Proximo part (bin/proximo), the application starts up with no errors.

This is the full stacktrace. What am I missing?

Exception in thread "main" java.net.BindException: Cannot assign requested address
 at sun.nio.ch.Net.bind0(Native Method)
 at sun.nio.ch.Net.bind(Net.java:344)
 at sun.nio.ch.Net.bind(Net.java:336)
 at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
 at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
 at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:162)
 at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
 at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:240)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
 at org.eclipse.jetty.server.Server.doStart(Server.java:270)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
like image 362
Søren Nødskov Hansen Avatar asked Nov 13 '22 15:11

Søren Nødskov Hansen


1 Answers

Remember you can only use the port that Heroku provides in the $PORT var.

Therefore:

web: bin/proximo [your existing command]

needs to include this, e.g:

web: bin/proximo [your existing command] -p $PORT

or whatever you need to dictate the port your web process runs on.

like image 97
Neil Middleton Avatar answered Nov 15 '22 05:11

Neil Middleton