Bind and Ports

Binding

Jboss comes configured so that it is bound only to localhost. This means that a url like http://localhost:8080/jmx-console/ will work whereas one like http://99.99.99.99:8080/jmx-console/ will not.

To access the server remotely you need to set the binding. This is done in our startup with the option

-b 0.0.0.0

that is, bind to any address. This is a security issue in that the consoles are now exposed to the outside world so need to be configured so that access is required.

Setting ports

A number of services are started using various ports. These are defined in the server/default/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml file.

Entries have the form:

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

Ports defined currently are:

  • Naming Service: 1099
  • Remote classloading service: 8083
  • Remoting Connector: 4446
  • multihome Remoting server: 7777, 8888
  • RMI/JRMP invoker:4444
  • Pooled invoker: 4445
  • listening socket for the HA-JNDI service: 1100
  • Socket HA-JNDI service uses to receive RMI requests from client proxies: 1101, 1102
  • Multicast socket on which HA-JNDI listens for auto-discovery requests from clients: 1102
  • HA RMI/JRMP invoker4447
  • HA Pooled invoker: 4448
  • IIOP socket for the Corba ORB: 3528
  • Trap receiver that acts as an SNMP Manager: 1162
  • The SNMP adaptor MBean:1161
  • RMI/JRMP socket for connecting to the JMX MBeanServer: 1090
  • JBoss Web HTTP connector socket: 8080
  • JBoss Web HTTPS connector socket: 8443 (derived from HTTP port value)
  • JBoss Messaging 1.x: 4457
  • JBoss Messaging 2.x: 5445, 5446
  • JBossTS Recovery Manager: 4712
  • JBossTS Transaction Status Manager:4713
  • JBossTS SocketProcessId: 4714

This bean allows ports to be shifted by beans which can add a value to the defined port number. Alternatively the actual definitions may be changed.

A number fo transformation beans are defined for example a bean which shifts by 100 is defined as

   <!-- The ports-01 bindings are obtained by taking the base bindings and adding 100 to each port value -->
   <bean name="Ports01Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
      <constructor>
         <!--  The name of the set -->
         <parameter>ports-01</parameter>
         <!-- Default host name -->
         <parameter>${jboss.bind.address}</parameter>
         <!-- The port offset -->
         <parameter>100</parameter>
         <!-- Set of bindings to which the "offset by X" approach can't be applied -->
         <parameter><null/></parameter>
      </constructor>
   </bean>

Near the start of the file is the invocation of the transform:

         <!-- The name of the set of bindings to use for this server -->
         <parameter>${jboss.service.binding.set:ports-default}</parameter>

The default, ports-default adds 0.

A bean can be defined which shifts by an amount specified as a system property or one of the existing beans can be used

   <!-- The ports-syspar bindings are obtained by taking ports-default and adding the value of the parameter
        org.bedework.system.ports.offset to each port value -->
   <bean name="PortsSysparBindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
      <constructor>
         <!--  The name of the set -->
         <parameter>ports-syspar</parameter>
         <!-- Default host name -->
         <parameter>${jboss.bind.address}</parameter>
         <!-- The port offset -->
         <parameter>${org.bedework.system.ports.offset}</parameter>
         <!-- Set of bindings to which the "offset by X" approach can't be applied -->
         <parameter><null/></parameter>
      </constructor>
   </bean>

Further up the file add it to the list

         <!--  The binding sets -->
         <parameter>
            <set>
               <inject bean="PortsDefaultBindings"/>
               <inject bean="Ports01Bindings"/>
               <inject bean="Ports02Bindings"/>
               <inject bean="Ports03Bindings"/>
               <inject bean="PortsSysparBindings"/>
            </set>
         </parameter>

To invoke this add a property definition at startup

./run.sh -c default -Dorg.bedework.system.ports.offset=505 -Djboss.service.binding.set=ports-syspar