[2.3.0] http.address setting ignored?

96 views
Skip to first unread message

Mirko Stocker

unread,
Jun 23, 2014, 8:13:17 AM6/23/14
to play-fr...@googlegroups.com
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?

Mirko Stocker

unread,
Jun 23, 2014, 8:28:33 AM6/23/14
to play-fr...@googlegroups.com

    % ./activator run -Dhttp.port=18080 -J-Dhttp.address=152.96.214.185

Oops, copied the wrong line, this should be -Dhttp.address, without the -J

Mirko Stocker

unread,
Jun 24, 2014, 3:22:38 AM6/24/14
to play-fr...@googlegroups.com

    % ./activator run -Dhttp.port=18080 -J-Dhttp.address=152.96.214.185

Ok, when I quote the whole argument list I'm getting one step further, but then it still fails:

activator "start -Dhttp.port=1234 -Dhttp.address=127.0.0.1"
...
Oops, cannot start the server.org.jboss.netty.channel.ChannelException: Failed to bind to: "127.0.0.1" :1234


        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: Unresolved address
        at sun.nio.ch.Net.translateToSocketException(Net.java:157)
        at sun.nio.ch.Net.translateException(Net.java:183)
        at sun.nio.ch.Net.translateException(Net.java:189)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:76)

        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:745)


Reply all
Reply to author
Forward
0 new messages