52

I'm running JBoss AS7 in a standalone mode using ./standalone.sh. This binds JBOSS to only localhost. Is there a way to bind it to all the hosts, I mean 0.0.0.0.

The older versions had the -b option to pass 0.0.0.0, I can't find any options to use over here.

Beryllium
  • 12,808
  • 10
  • 56
  • 86
Chander Shivdasani
  • 9,878
  • 20
  • 76
  • 107
  • 2
    Can you try editing standalone.xml and setting inet-address to 0.0.0.0? See http://community.jboss.org/wiki/MultipleInstancesOfJBossAS7OnTheSameMachine . – Dave Jul 28 '11 at 03:37

4 Answers4

103

Edit standalone/configuration/standalone.xml and insert the tag any-address instead of inet-address bound to 127.0.0.1 - Example:

<interfaces>
    <interface name="management">
        <inet-address value="127.0.0.1"/>
    </interface>
    <interface name="public">
        <any-address/>
    </interface>
</interfaces>

In the public interface, I've changed the original inet-address with any-address. After restarting, you'll be able to browse JBoss port 8080 over the network.

stivlo
  • 83,644
  • 31
  • 142
  • 199
18

Thanks for the tip above, FYI I discover that using <any-address/> might lead to

10:31:22,605 ERROR [org.apache.catalina.core.StandardService] (MSC service thread 1-2) Connector.start: LifecycleException:  service.getName(): "jboss.web";  Protocol handler start failed: java.net.SocketException: Protocol family not supported
    at org.apache.catalina.connector.Connector.start(Connector.java:1058)

cf. http://community.jboss.org/thread/168789?tstart=120

You might workaround it by replacing it by <any-ipv4-address/>

that gives you :

<interfaces>
    <interface name="management">
        <inet-address value="127.0.0.1"/>
    </interface>
    <interface name="public">
        <any-ipv4-address/>
    </interface>
</interfaces>
Tuna
  • 2,937
  • 4
  • 37
  • 61
Francois
  • 1,851
  • 1
  • 13
  • 15
  • 1
    +1 what ever the reason for this is. My Jboss instance did work with `` as long as it was started manually by executing `standalone.xml`. Only when I configured it to run as a windows service this problem came up and was solved by changing it to `` – Jens Mar 22 '13 at 11:22
  • Hi I am new to JBoss 7.1.1 can you also explain the purpose of "interface name="management" ...inet-address value="127.0.0.1" " – Twaha Mehmood Jun 01 '15 at 10:17
13

We just added support for -b in 7.0.2.

Benoit Garret
  • 14,027
  • 4
  • 59
  • 64
Jason Greene
  • 131
  • 1
  • 2
8

You can also do the following:

<interfaces>
    <interface name="management">
        <inet-address value="127.0.0.1"/>
    </interface>
    <interface name="public">
        <inet-address value="0.0.0.0"/>
    </interface>
</interfaces>

or if you want to bind to a particular address, replace 0.0.0.0 with the ip.