JBoss port configuration

This tutorial discusses about WildFly and JBoss AS port configuration, which is different in the various server releases. 

WildFly / JBoss EAP 6

JBoss EAP 6 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"/>
        </outbound-socket-binding>
    </socket-binding-group>

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:

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

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"/>
</server-group>

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:230.0.0.4}" 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:230.0.0.4}" multicast-port="45688"/>
    <socket-binding name="jgroups-udp-fd" interface="private" port="54200"/>
    <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" 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"/>
    </outbound-socket-binding>
</socket-binding-group>

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">
   <constructor>
       <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>
       </bean>

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

     </set>
     </parameter>
   </constructor>
 </bean>

Supposing we have bound JBoss AS to the IP Address 10.2.20.156, here's the list of ports engaged by the application server:
TCP    10.2.20.156:1090       <--- RMI/JRMP socket for connecting to the JMX MBeanServer
TCP    10.2.20.156:1091       <--- RMI server socket
TCP    10.2.20.156:1099       <--- JNDI Service
TCP    10.2.20.156:1098       <--- RMI Port for JNDI Service
TCP    10.2.20.156:4446       <--- JBoss Remoting Connector
TCP    10.2.20.156:4712       <--- JBossTS Service
TCP    10.2.20.156:4713       <--- JBossTS Service
TCP    10.2.20.156:5445       <--- HornetQ JMS Service
TCP    10.2.20.156:5455       <--- HornetQ Netty port
TCP    10.2.20.156:5500       <--- JBoss Remoting
TCP    10.2.20.156:5501       <--- JBoss Remoting ssl
TCP    10.2.20.156:8009       <--- Web server AjpConnector
TCP    10.2.20.156:8080       <--- Web server HTTP Connector
TCP    10.2.20.156:8083       <--- Web services

Clustered servers will additionally open the following ports:


TCP    10.2.20.156:1100       <--- HA JNDI Service
TCP    10.2.20.156:1101       <--- HA JNDI Service
TCP    10.2.20.156:3528       <--- 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

<parameter>${jboss.service.binding.set:ports-01}</parameter>

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.

Related articles available on mastertheboss.com

JBoss MBeans POJO

JMX MBean services are the core building blocks of the JBoss Appl

How to a dump of JNDI tree with JMX console ?

#2 JBoss Howto. This is the recipe of the day

How to configure JBoss to bind to a different IP ?

  If you want to change the jboss.bind.address property use the 

How to shut down JBoss from remote ?

JBoss recipe of the day

How to create multiple instances of an Mbean?

  Supposing you need two instances of an MBean, let's say one fo

JBoss classloader issues

By default JBoss (prior to version 3.2) uses a flat class loading

Follow us on Twitter