Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBoss WildFly: Starts but can't connect?

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?

like image 680
user_vs Avatar asked Nov 13 '14 10:11

user_vs


People also ask

Is JBoss and WildFly same?

JBoss EAP is just a commercial build of the Wildfly project. In many ways, especially from a source code perspective, JBoss and Wildfly are the same thing. “Wildfly is the upstream project JBoss EAP is built on,” said James Falkner, technical product manager for Red Hat Runtimes.


3 Answers

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:

  • WildFly - Interfaces and ports
  • WildFly - Command line parameters

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>
like image 107
Federico Sierra Avatar answered Oct 18 '22 22:10

Federico Sierra


The <any-ipv4-address/> is deprecated in WF 9, use:

 ...   
    <interface name="management">
       <any-address/>
    </interface>
 ...
like image 30
bkomac Avatar answered Oct 18 '22 22:10

bkomac


(I summary 2 answers for a working solution) I am using WildFly 10.0.0.Final - lastest version at writing time. Look for file standalone.xml like this:

On Windows

C:\tools\wildfly-10.0.0.Final\standalone\configuration\standalone.xml

Or Linux, like this:

/home/vyhn.net/wildfly-servlet-10.0.0.Final/standalone/configuration/standalone.xml

edit become to:

<interfaces>
    <interface name="management">
        <!-- Allow all external IP -->
        <any-address/>
    </interface>
    <interface name="public">
        <!-- Allow all external IP -->
    <any-address/>
    </interface>
</interfaces>

Then go to:

http://your_domain:9990/error/index.html

(port 9990 is default HTTP port, if you use firewall or iptables, remember open port 9990) For example:

http://vyhn.net:9990/error/index.html

You will see it works successful.
Lastest reference (WildFly 10): https://docs.jboss.org/author/display/WFLY10/Interfaces+and+ports

like image 4
Do Nhu Vy Avatar answered Oct 18 '22 22:10

Do Nhu Vy