JBoss port configuration

This tutorial discusses about to change the defaut ports for WildFly and JBoss EAP through the various server releases. We will learn how to change a single port definition, such as the default 8080 port and how to shift all ports with a unit called offset.

WildFly / JBoss EAP

JBoss EAP  and WildFly use Socket Binding groups to configure the network ports, which will be open and listening for incoming connections. In Standalone mode, there is a single Socket Binding Group which is used to define port settings:

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="http" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>

For example, if you want to change the default 8080 port for the HTTP Server, you can pass the jboss.http.port attribute as System Property:

$ ./standalone.sh -Djboss.http.port=8090

Most of the times, it is preferrable to define an offset for all ports used by the application server through the jboss.socket.binding.port­offset attribute can be used to shift all port definitions of a fixed number, in case you want to run multiple application servers on the same machine. Example:

$ ./standalone.sh -Djboss.socket.binding.port-offset=100

The corresponding interfaces used to bind the ports are defined by the default-interface attribute. Here are the default interfaces available:

        <interface name="management">
            <inet-address value="${jboss.bind.address.management:}"/>
        <interface name="public">
            <inet-address value="${jboss.bind.address:}"/>

When you are running in Domain mode, there are multiple Socket Binding Groups which can be assigned to a Server group:

<server-group name="main-server-group" profile="full-ha">  
    <socket-binding-group ref="full-ha-sockets"/>

In the above example, the main-server-group uses the fulkl-ha-sockets configuration:

<socket-binding-group name="full-ha-sockets" default-interface="public">
    <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
    <socket-binding name="http" port="${jboss.http.port:8080}"/>
    <socket-binding name="https" port="${jboss.https.port:8443}"/>
    <socket-binding name="iiop" interface="unsecure" port="3528"/>
    <socket-binding name="iiop-ssl" interface="unsecure" port="3529"/>
    <socket-binding name="jgroups-mping" interface="private" port="0" multicast-address="${jboss.default.multicast.address:}" multicast-port="45700"/>
    <socket-binding name="jgroups-tcp" interface="private" port="7600"/>
    <socket-binding name="jgroups-tcp-fd" interface="private" port="57600"/>
    <socket-binding name="jgroups-udp" interface="private" port="55200" multicast-address="${jboss.default.multicast.address:}" multicast-port="45688"/>
    <socket-binding name="jgroups-udp-fd" interface="private" port="54200"/>
    <socket-binding name="modcluster" port="0" multicast-address="" multicast-port="23364"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>

Please notice that WildFly uses the port 9990 for all management interfaces (Web interface and CLI). The EAP 6/ AS 7 native port 9999 has been deprecated so update your scripts accordingly.

JBoss AS 5

The JBoss AS port configuration file is located in conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml.  This file gathers port configuration information about both AS services and the Web server services.

Actually the release Community version JBoss AS 6.x of the application server provides a richer abstraction by removing port definitions also from the Web server configuration file (server.xml) which now contains an application server property

<Connector protocol="HTTP/1.1" port="${jboss.web.http.port}" address="${jboss.bind.address}" 
 redirectPort="${jboss.web.https.port}" />

 <Connector protocol="AJP/1.3" port="${jboss.web.ajp.port}" address="${jboss.bind.address}"
 redirectPort="${jboss.web.https.port}" />

The single service ports are properties of the StandardBindings Bean.

<bean name="StandardBindings" class="java.util.HashSet">
       <parameter class="java.util.Collection">
       <set elementClass="org.jboss.services.binding.ServiceBindingMetadata">

       <!-- Naming Service -->
       <bean class="org.jboss.services.binding.ServiceBindingMetadata">
         <property name="serviceName">jboss:service=Naming</property>
         <property name="bindingName">Port</property>
         <property name="port">1099</property>
         <property name="description">The listening socket for the Naming service</property>

. . . . . . . . . . . .


Supposing we have bound JBoss AS to the IP Address, here’s the list of ports engaged by the application server:
TCP       <— RMI/JRMP socket for connecting to the JMX MBeanServer
TCP       <— RMI server socket
TCP       <— JNDI Service
TCP       <— RMI Port for JNDI Service
TCP       <— JBoss Remoting Connector
TCP       <— JBossTS Service
TCP       <— JBossTS Service
TCP       <— HornetQ JMS Service
TCP       <— HornetQ Netty port
TCP       <— JBoss Remoting
TCP       <— JBoss Remoting ssl
TCP       <— Web server AjpConnector
TCP       <— Web server HTTP Connector
TCP       <— Web services

Clustered servers will additionally open the following ports:

TCP       <— HA JNDI Service
TCP       <— HA JNDI Service
TCP       <— Corba IIOP Service

The Service Binding Manager

The Service Binding Manager co-ordinates which ports the JBoss Application Server instance listens on when it starts up and the Administration Console provides a mechanism for configuring this service to change which ports get used.

The Service Binding Manager can be used to change the default port sets, without changing the single service ports.

Out of the box, the JBoss Application Server 5 ships with four port sets defined as:

* ports-default: The standard ports, for instance JBoss HTTP is on 8080.
* ports-01: The standard ports incremented by 100. For example, HTTP is on 8180
* ports-02: The standard ports incremented by 200. For example, HTTP is on 8280
* ports-03: The standard ports incremented by 300. For example, HTTP is on 8380

In order to change the port set you can edit the file bindings-jboss-beans.xml and set for example the ports-01


You can as well change the Service Binding ports from the start-up script of the application server. For example:

run -Djboss.service.binding.set=ports-01

This is pretty useful if you don’t have to maintain a separate copy of the all folder if you want to, say, start up multiple instances of JBoss running as a cluster.

You can change Port binding by means of the JBoss AS admin console: reach the Service Binding Manager thorough the path <machine> : JBossAS Servers : JBoss AS 6 (default) : Service Binding Manager.

Next go to its Configuration tab and for the Active Binding Set Name property enter the name of the new port set you wish the JBoss Application Server instance to use and hit the SAVE button at the bottom of the page.

jboss port configuration

Select the Service Binding Sets  folder from the navigation, hit the Add a new resource button on the main panel and enter in the necessary information.
Once you have updated the configuration for the Service Binding Manager, the JBoss Application Server instance must be restarted for those changes to take effect.

See the following article for more details about the error “java.net.BindException: Address already in use: JVM_Bind ” : Solving java.net.BindException: Address already in use: JVM_Bind