Hi,
I'm trying to run a Play 2.3 application in a fairly restrictive environment (Openshift), meaning that I have to bind to a specific IP address. When I specify the -Dhttp.address, the server still seems to listen to all interfaces:
% ./activator run -Dhttp.port=18080 -J-Dhttp.address=152.96.214.185
[info] Loading global plugins from /home/misto/.sbt/0.13/plugins
[info] Loading project definition from XX
[info] Set current project to template (in build file:XX)
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:18080
The port setting seems to work, so I my options are picked up, but it still listens to all interfaces. This works fine on my local system, but on Openshift it will abort
org.jboss.netty.channel.ChannelException: Failed to bind to: /
0.0.0.0:18080 at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
at play.core.server.NettyServer$$anonfun$8.apply(NettyServer.scala:92)
at play.core.server.NettyServer$$anonfun$8.apply(NettyServer.scala:89)
at scala.Option.map(Option.scala:145)
at play.core.server.NettyServer.<init>(NettyServer.scala:89)
at play.core.server.NettyServer$.createServer(NettyServer.scala:206)
at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:243)
at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:238)
at scala.Option.map(Option.scala:145)
at play.core.server.NettyServer$.main(NettyServer.scala:238)
at play.core.server.NettyServer.main(NettyServer.scala)
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:372)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:296)
at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Any ideas?