Configuring JBoss to listen on all IP addresses or a specific IP addresses

Document ID : KB000050166
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

By default JBoss is configured to listen on the primary NIC IP address. As a result, you can get some errors on the server.log like the following:

[org.jnp.interfaces.NamingContext] Failed to connect to localhost:1099
javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]

Solution:

In order to fix this issue you have to configure JBoss to listen on either the specific IP or all machines IPs.

There are 2 options to configure listening on all ports, with the Java service wrapper and without the Java service wrapper:

These are the steps you shall take in order to configure JBoss listening while running as the Java wrapper service:

  1. Open the wrapper.conf file and search for:

    # Application parameters. Add parameters as needed starting from 1
    wrapper.app.parameter.1=org.jboss.Main

  2. Add the following lines:

    wrapper.app.parameter.2=-b
    wrapper.app.parameter.3=0.0.0.0

This will enable JBoss listening on any IP address of your machine.

If you want to configure JBoss to listen on a specific port, change the 0.0.0.0 to the specific port.

These are the steps you shall take in order to configure JBoss listening on specific port while running from the run_idm.bat or run_idm.sh

On windows open the run_idm.bat and look for the following line:
call .\run.bat %ARGS% -b 0.0.0.0

On Solaris or Linux open the run_idm.sh and look for the following line:
sh ./run.sh ${ARGS} -b 0.0.0.0

In order to listen on a specific port, change the 0.0.0.0 to the specific IP

For example:

call .\run.bat %ARGS% -b 192.168.1.10
sh ./run.sh ${ARGS} -b 192.168.1.20