The AS7 book!

JBoss Tuning

JBoss 5 book

No Registration required. Use your FB account to add comments to articles.

Twitter Button

Poll

Which is your favourite JSF library?
 
Top Programming Sites
Home JBoss AS JBoss port configuration

JBoss port configuration

Article Index
JBoss port configuration
Solving Port conflicts
All Pages
  

JBoss_appiconThis tutorial discusses about JBoss AS port configuration, which has changed since the release 5.1 of the application server adotping a new standard which is also part of the new 6.x release. 

One of the major changes introduced by JBoss AS 5.1 release is the configuration of the application server ports, which are not spread any more across different files.

 

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 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 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.