JBoss WildFly: Starts but can't connect?

user_vs picture user_vs · Nov 13, 2014 · Viewed 33.3k times · Source

I just configured JBoss WildFly. It is running and it is accessible from the same machine, everything is working fine...

My problem is that it is not accessible from another system (I mean in a network, the server (hosted machine) URL can't access from another system).

How can I solve this?

Answer

Federico Sierra picture Federico Sierra · Nov 13, 2014

By default jboss/wildfly binding to localhost, if you want change this, you can execute:

standalone.sh -b 0.0.0.0

listen on all IP addresses of the machine (if multihomed)

Another alternative is configure in standalone.xml the interfaces section.

Change:

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

to:

<interfaces>
  <interface name="management">
   <!-- Use the IPv4 wildcard address -->
   <any-ipv4-address/>
  </interface>
  <interface name="public">
   <!-- Use the IPv4 wildcard address -->
   <any-ipv4-address/>
  </interface>
</interfaces>

Ref:

UPDATE

From Wildfly 8 <any-ipv4-address/> was deprecated and remove in Wildfly 9, then if you are in 9.x or higher use <any-address/>.

Deprecated. In the absence of -Djava.net.preferIPv4Stack=true, the JVM cannot be instructed to bind a socket to all IPv4 addresses, but only to IPv4 addresses, so the intended semantic cannot be obtained via this setting alone. Since using any-addressType and setting -Djava.net.preferIPv4Stack=true provides the same effect, this any-ipv4-addressType will be removed in a future release.

Eg:

<interface name="global">
   <!-- Use the wildcard address -->
   <any-address/>
</interface>