Tuesday, 2 September 2014

JBOSS 7_1_1_1_Final Version Application Deployment

 Where the JBoss-AS-7.1.1.Final instance have been installed?
/<<Server Path>>/app/jboss-as-7.1.1.Final


3. How to start partners application?
  --Goto  /<<Server Path>>/app/jboss-as-7.1.1.Final/bin
  --Type /nohup ./standalone.sh > nohup.out &

4. Which Java version is used for Partners Production and which location JRE was installed?
- We use jre1.7.0
-JRE Installation location is /u05/app/jre1.7.0

5. How to locate the JRE instance used by JBOSS 7 AS?
-Run ps -ef | grep 'jre'
-Look for JRE instance similar to the below listed one.
    root 28021 27996   0 11:44:29 ?           2:23 /u05/app/jre1.7.0/bin/java -D [Standalone] -server -XX:+TieredCompilation -Xms64

6. Ho to stop partners application?
-Type the following command
sudo kill -9 <process id>
sudo password: pass4theday

7. How partners application WAR file can be deployed in production environment?

Step #1: FTP the partners <<APP_NAME>>.war into the deployment folder
/u14/app/jboss-as-7.1.1.Final/standalone/deployments

Step #2: create an empty file in the following file format name
<<APP_NAME>>.war.dodeploy

This file name indicates that the application has to be deployed/redepoyed after any changes in the war file content.

Step #3: After the successful deployment, the file <<APP_NAME>>.war.dodeploy will be been renamed into <<APP_NAME>>.war.deployed

8. What files to be modified to point the preferred JAVA_HOME location?

The File to be modified to make JAVA_HOME entry is /u14/app/jboss-as-7.1.1.Final/bin/standalone.conf
Make sure you have the following JAVA_HOME entry in the file.


#
# Specify the location of the Java home directory.  If set then $JAVA will
# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
#
JAVA_HOME="/u05/app/jre1.7.0"

9. How to configure the preferred port (other than 8080) in JBoss-AS-7.1.1.Final Version?

You can configure JBoss instance to listen to a particular port.
The file which needs to be modified for port configuration is  /u14/app/jboss-as-7.1.1.Final/bin/standalone.sh

Make sure you are making the highlighted changes in the following section.

 if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then
      # Execute the JVM in the foreground
      eval \"$JAVA\" -D\"[Standalone]\" $JAVA_OPTS \
         \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/boot.log\" \
         \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
         -jar \"$JBOSS_HOME/jboss-modules.jar\" \
         -mp \"${JBOSS_MODULEPATH}\" \
         -jaxpmodule "javax.xml.jaxp-provider" \
         org.jboss.as.standalone \
         -Djboss.home.dir=\"$JBOSS_HOME\" \
         -Djboss.socket.binding.port-offset=900 \
         -b=0.0.0.0 \
         "$@"
      JBOSS_STATUS=$?
   else
      # Execute the JVM in the background
      eval \"$JAVA\" -D\"[Standalone]\" $JAVA_OPTS \
         \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/boot.log\" \
         \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
         -jar \"$JBOSS_HOME/jboss-modules.jar\" \
         -mp \"${JBOSS_MODULEPATH}\" \
         -jaxpmodule "javax.xml.jaxp-provider" \
         org.jboss.as.standalone \
         -Djboss.home.dir=\"$JBOSS_HOME\" \
         -Djboss.socket.binding.port-offset=900 \
         -b=0.0.0.0 \
         "$@" "&"
      JBOSS_PID=$!
      # Trap common signals and relay them to the jboss process
      trap "kill -HUP  $JBOSS_PID" HUP
      trap "kill -TERM $JBOSS_PID" INT
      trap "kill -QUIT $JBOSS_PID" QUIT
      trap "kill -PIPE $JBOSS_PID" PIPE
      trap "kill -TERM $JBOSS_PID" TERM
      if [ "x$JBOSS_PIDFILE" != "x" ]; then
        echo $JBOSS_PID > $JBOSS_PIDFILE
      fi

The above highlighted line indicates that I am configuring my JBoss instance to listen port 8980. (i.e, 8080 is default and adding additional offset 900 to become 8980)

10. What changes I should do in partners.properties file?

Make sure you are pointing to the production database i.e, <<SERVER_NAME>>
Document on configuring JBoss instance under a specific port in ABC (Dev Server)

Introduction
This document explains you about how we can configure multiple JBoss instances running in various ports in ABC development server environment.

Background
In the dev server environment we have installed multiple JBoss instances to deploy certain Java/GWT based applications. Currently  four  JBoss instances are running with the following ports.
i.                     Port #8180
ii.                   Port #8280
iii.                 Port #8880
iv.                 Port #8980
It is really a challenging one to identify and configuring the new ports with new JBoss instances. I am going to walk through the steps involved in case if you want to introduce a new port of JBoss instances in ABCtest server.


Steps Involved

Step #1: Install JBoss Application Server
Install JBoss Application server in ABC.
Required JBoss Version: jboss-6.0.0.M1
JBoss Installation Folder Path : /u14/app/jboss-6.0.0.M1-8880
Refer the below file content and you will see colored line are the one which needs to be changed.

Note:- Don,’t install jboss-6.0.0.Final version of JBoss, because it has incompatible list of JAR files which are not matching with the new version.

Step #2 Edit run.sh file
Edit run.sh and file and should be look like. Also, I have colored in the following which require some configuration whenever a new  new port added. Run.sh file is available under  /u14/app/jboss-6.0.0.M1-8880/bin.
#!/bin/sh
### ======================================================================

##
##  
 ##
##  JBoss Bootstrap Script                                                 
##                                                                         
### ====================================================================== ###

### $Id: run.sh 93683 2009-09-18 11:24:08Z mladen.turk@jboss.com $ ###

DIRNAME=`dirname $0`
PROGNAME=`basename $0`
GREP="grep"

# Use the maximum available, or set MAX_FD != -1 to use that
MAX_FD="maximum"

#
# Helper to complain.
#
warn() {
    echo "${PROGNAME}: $*"
}

#
# Helper to puke.
#
die() {
    warn $*
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
linux=false;
case "`uname`" in
    CYGWIN*)
        cygwin=true
        ;;

    Darwin*)
        darwin=true
        ;;

    Linux)
        linux=true
        ;;
esac

# Read an optional running configuration file
if [ "x$RUN_CONF" = "x" ]; then
    RUN_CONF="$DIRNAME/run.conf"
fi
if [ -r "$RUN_CONF" ]; then
    . "$RUN_CONF"
fi

# Force IPv4 on Linux systems since IPv6 doesn't work correctly with jdk5 and lower
if [ "$linux" = "true" ]; then
   JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
fi

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
    [ -n "$JBOSS_HOME" ] &&
        JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"`
    [ -n "$JAVA_HOME" ] &&
        JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
    [ -n "$JAVAC_JAR" ] &&
        JAVAC_JAR=`cygpath --unix "$JAVAC_JAR"`
fi

# Setup JBOSS_HOME
if [ "x$JBOSS_HOME" = "x" ]; then
    # get the full path (without any relative bits)
    JBOSS_HOME=`cd $DIRNAME/..; pwd`
fi
export JBOSS_HOME

# Increase the maximum file descriptors if we can
if [ "$cygwin" = "false" ]; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ "$?" -eq 0 ]; then
        # Darwin does not allow RLIMIT_INFINITY on file soft limit
        if [ "$darwin" = "true" -a "$MAX_FD_LIMIT" = "unlimited" ]; then
            MAX_FD_LIMIT=`/usr/sbin/sysctl -n kern.maxfilesperproc`
        fi

              if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
                  # use the system max
                  MAX_FD="$MAX_FD_LIMIT"
              fi

              ulimit -n $MAX_FD
              if [ "$?" -ne 0 ]; then
                  warn "Could not set maximum file descriptor limit: $MAX_FD"
              fi
    else
              warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# Setup the JVM
if [ "x$JAVA" = "x" ]; then
    if [ "x$JAVA_HOME" != "x" ]; then
              JAVA="$JAVA_HOME/bin/java"
    else
              JAVA="java"
    fi
fi

# Setup the classpath
runjar="$JBOSS_HOME/bin/run.jar"
if [ ! -f "$runjar" ]; then
    die "Missing required file: $runjar"
fi
JBOSS_BOOT_CLASSPATH="$runjar"

# Tomcat uses the JDT Compiler
# Only include tools.jar if someone wants to use the JDK instead.
# compatible distribution which JAVA_HOME points to
if [ "x$JAVAC_JAR" = "x" ]; then
    JAVAC_JAR_FILE="$JAVA_HOME/lib/tools.jar"
else
    JAVAC_JAR_FILE="$JAVAC_JAR"
fi
if [ ! -f "$JAVAC_JAR_FILE" ]; then
   # MacOSX does not have a seperate tools.jar
   if [ "$darwin" != "true" -a "x$JAVAC_JAR" != "x" ]; then
      warn "Missing file: JAVAC_JAR=$JAVAC_JAR"
      warn "Unexpected results may occur."
   fi
   JAVAC_JAR_FILE=
fi

if [ "x$JBOSS_CLASSPATH" = "x" ]; then
    JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH"
else
    JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH"
fi
if [ "x$JAVAC_JAR_FILE" != "x" ]; then
    JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JAVAC_JAR_FILE"
fi

# If -server not set in JAVA_OPTS, set it, if supported
SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
if [ "x$SERVER_SET" = "x" ]; then

    # Check for SUN(tm) JVM w/ HotSpot support
    if [ "x$HAS_HOTSPOT" = "x" ]; then
              HAS_HOTSPOT=`"$JAVA" -version 2>&1 | $GREP -i HotSpot`
    fi

    # Check for OpenJDK JVM w/server support
    if [ "x$HAS_OPENJDK_" = "x" ]; then
        HAS_OPENJDK=`"$JAVA" -version 2>&1 | $GREP -i OpenJDK`
    fi

    # Enable -server if we have Hotspot or OpenJDK, unless we can't
    if [ "x$HAS_HOTSPOT" != "x" -o "x$HAS_OPENJDK" != "x" ]; then
              # MacOS does not support -server flag
              if [ "$darwin" != "true" ]; then
                  JAVA_OPTS="-server $JAVA_OPTS"
              fi
    fi
fi

# Setup JBoss Native library path
#
if [ -d "$JBOSS_HOME/../native/lib" ]; then
    JBOSS_NATIVE_DIR=`cd "$JBOSS_HOME/../native" && pwd`
elif [ -d "$JBOSS_HOME/native/lib" ]; then
    JBOSS_NATIVE_DIR=`cd "$JBOSS_HOME/native" && pwd`
elif [ -d "$JBOSS_HOME/../native/lib64" ]; then
    JBOSS_NATIVE_DIR=`cd "$JBOSS_HOME/../native" && pwd`
elif [ -d "$JBOSS_HOME/native/lib64" ]; then
    JBOSS_NATIVE_DIR=`cd "$JBOSS_HOME/native" && pwd`
elif [ -d "$JBOSS_HOME/native/bin" ]; then
    JBOSS_NATIVE_DIR=`cd "$JBOSS_HOME/native" && pwd`
elif [ -d "$JBOSS_HOME/bin/native" ]; then
    JBOSS_NATIVE_DIR=`cd "$JBOSS_HOME/bin/native" && pwd`
fi
if [ -d "$JBOSS_NATIVE_DIR" ]; then
    if $cygwin; then
        JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/bin"
        export PATH="$JBOSS_NATIVE_DIR:$PATH"
        JBOSS_NATIVE_LIBPATH=`cygpath --path --windows "$JBOSS_NATIVE_DIR"`
    else
        IS_64_BIT_JVM=`"$JAVA" $JAVA_OPTS -version 2>&1 | $GREP -i 64-bit`
        if [ "x$IS_64_BIT_JVM" != "x" ]; then
            JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib64"
        else
            JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib"
        fi
        if [ "x$LD_LIBRARY_PATH" = "x" ]; then
          LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR"
        else
          LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR:$LD_LIBRARY_PATH"
        fi
        export LD_LIBRARY_PATH
        JBOSS_NATIVE_LIBPATH=$LD_LIBRARY_PATH
    fi
    if [ "x$JAVA_OPTS" = "x" ]; then
        JAVA_OPTS="-Djava.library.path=$JBOSS_NATIVE_LIBPATH"
    else
        JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$JBOSS_NATIVE_LIBPATH"
    fi
fi

# Setup JBoss specific properties
JAVA_OPTS="-Dprogram.name=$PROGNAME $JAVA_OPTS"

# Setup the java endorsed dirs
JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed"

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
    JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
    JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"`
    JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"`
fi

# Display our environment
echo "========================================================================="
echo ""
echo "  JBoss Bootstrap Environment"
echo ""
echo "  JBOSS_HOME: $JBOSS_HOME"
echo ""
echo "  JAVA: $JAVA"
echo ""
echo "  JAVA_OPTS: $JAVA_OPTS"
echo ""
echo "  CLASSPATH: $JBOSS_CLASSPATH"
echo ""
echo "========================================================================="
echo ""

while true; do
   if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then
      # Execute the JVM in the foreground
      "$JAVA" -D8880 -Djboss.service.binding.set=ports-08 -Djboss.messaging.ServerPeerID=8 $JAVA_OPTS \
         -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
         -classpath "$JBOSS_CLASSPATH" \
         org.jboss.Main -b 0.0.0.0 "$@"
      JBOSS_STATUS=$?
   else
      # Execute the JVM in the background
      "$JAVA" -D8880 -Djboss.service.binding.set=ports-08 -Djboss.messaging.ServerPeerID=8 $JAVA_OPTS \
         -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
         -classpath "$JBOSS_CLASSPATH" \
         org.jboss.Main -b 0.0.0.0 "$@" &
      JBOSS_PID=$!
      # Trap common signals and relay them to the jboss process
      trap "kill -HUP  $JBOSS_PID" HUP
      trap "kill -TERM $JBOSS_PID" INT
      trap "kill -QUIT $JBOSS_PID" QUIT
      trap "kill -PIPE $JBOSS_PID" PIPE
      trap "kill -TERM $JBOSS_PID" TERM
      # Wait until the background process exits
      WAIT_STATUS=128
      while [ "$WAIT_STATUS" -ge 128 ]; do
         wait $JBOSS_PID 2>/dev/null
         WAIT_STATUS=$?
         if [ "${WAIT_STATUS}" -gt 128 ]; then
            SIGNAL=`expr ${WAIT_STATUS} - 128`
            SIGNAL_NAME=`kill -l ${SIGNAL}`
            echo "*** JBossAS process (${JBOSS_PID}) received ${SIGNAL_NAME} signal ***" >&2
         fi
      done
      if [ "${WAIT_STATUS}" -lt 127 ]; then
         JBOSS_STATUS=$WAIT_STATUS
      else
         JBOSS_STATUS=0
      fi
   fi
   # If restart doesn't work, check you are running JBossAS 4.0.4+
   #    http://jira.jboss.com/jira/browse/JBAS-2483
   # or the following if you're running Red Hat 7.0
   #    http://developer.java.sun.com/developer/bugParade/bugs/4465334.html
   if [ "$JBOSS_STATUS" -eq 10 ]; then
      echo "Restarting JBoss..."
   else
      exit $JBOSS_STATUS
   fi
done




Step #3 Edit bindings-jboss-beans.xml file
You need to edit bindings-jboss-beans.xml ad add certain changes. This file is existing in the folder /u14/app/jboss-6.0.0.M1-8880/server/default/conf/bindingservice.beans/META-INF/.
 The changes are highlighted with color:

<?xml version="1.0" encoding="UTF-8"?>

<deployment xmlns="urn:jboss:bean-deployer:2.0">
  
   <!-- The actual SBM from which services obtain binding information -->
   <bean name="ServiceBindingManager" class="org.jboss.services.binding.ServiceBindingManager">

      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.system:service=ServiceBindingManager", exposedInterface=org.jboss.services.binding.ServiceBindingManagerMBean.class, registerDirectly=true)</annotation>
     
      <!-- Here we use the ServiceBindingManagementObject as a factory to create the SBM -->
      <constructor factoryMethod="getServiceBindingManager">    
         <factory bean="ServiceBindingManagementObject"/>
      </constructor>

   </bean>

   <!-- Provides management tools with a ProfileService ManagementView
        interface to the SBM and its components -->
   <bean name="ServiceBindingManagementObject"
         class="org.jboss.services.binding.managed.ServiceBindingManagementObject">
        
      <constructor>
         <!-- The name of the set of bindings to use for this server -->
         <parameter>${jboss.service.binding.set:ports-default}</parameter>
         
         <!--  The binding sets -->
         <parameter>
            <set>
               <inject bean="PortsDefaultBindings"/>
               <inject bean="Ports01Bindings"/>
               <inject bean="Ports02Bindings"/>
               <inject bean="Ports03Bindings"/>
               <inject bean="Ports04Bindings"/>
               <inject bean="Ports05Bindings"/>
               <inject bean="Ports06Bindings"/>
               <inject bean="Ports07Bindings"/>
               <inject bean="Ports08Bindings"/>
               <inject bean="Ports09Bindings"/>
            </set>
         </parameter>
        
         <!-- Base binding metadata that is used to create bindings for each set -->
         <parameter><inject bean="StandardBindings"/></parameter>
        
      </constructor>
   </bean>
  
  
   <!-- The ports-default bindings are obtained by taking the base bindings and adding 0 to each port value  -->
   <bean name="PortsDefaultBindings"  class="org.jboss.services.binding.impl.ServiceBindingSet">
      <constructor>
         <!--  The name of the set -->
         <parameter>ports-default</parameter>
         <!-- Default host name -->
         <parameter>${jboss.bind.address}</parameter>
         <!-- The port offset -->
         <parameter>0</parameter>
         <!-- Set of bindings to which the "offset by X" approach can't be applied -->
         <parameter><null/></parameter>
      </constructor>
   </bean>

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

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

   <!-- The ports-03 bindings are obtained by taking ports-default and adding 300 to each port value -->
   <bean name="Ports03Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
      <constructor>
         <!--  The name of the set -->
         <parameter>ports-03</parameter>
         <!-- Default host name -->
         <parameter>${jboss.bind.address}</parameter>
         <!-- The port offset -->
         <parameter>300</parameter>
         <!-- Set of bindings to which the "offset by X" approach can't be applied -->
         <parameter><null/></parameter>
      </constructor>
   </bean>
  
    <!-- The ports-04 bindings are obtained by taking ports-default and adding 400 to each port value -->
      <bean name="Ports04Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
         <constructor>
            <!--  The name of the set -->
            <parameter>ports-04</parameter>
            <!-- Default host name -->
            <parameter>${jboss.bind.address}</parameter>
            <!-- The port offset -->
            <parameter>400</parameter>
            <!-- Set of bindings to which the "offset by X" approach can't be applied -->
            <parameter><null/></parameter>
         </constructor>
      </bean>
  
      <!-- The ports-05 bindings are obtained by taking ports-default and adding 500 to each port value -->
      <bean name="Ports05Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
         <constructor>
            <!--  The name of the set -->
            <parameter>ports-05</parameter>
            <!-- Default host name -->
            <parameter>${jboss.bind.address}</parameter>
            <!-- The port offset -->
            <parameter>500</parameter>
            <!-- Set of bindings to which the "offset by X" approach can't be applied -->
            <parameter><null/></parameter>
         </constructor>
      </bean>
  
      <!-- The ports-06 bindings are obtained by taking ports-default and adding 600 to each port value -->
      <bean name="Ports06Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
         <constructor>
            <!--  The name of the set -->
            <parameter>ports-06</parameter>
            <!-- Default host name -->
            <parameter>${jboss.bind.address}</parameter>
            <!-- The port offset -->
            <parameter>600</parameter>
            <!-- Set of bindings to which the "offset by X" approach can't be applied -->
            <parameter><null/></parameter>
         </constructor>
      </bean>
  
      <!-- The ports-07 bindings are obtained by taking ports-default and adding 700 to each port value -->
      <bean name="Ports07Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
         <constructor>
            <!--  The name of the set -->
            <parameter>ports-07</parameter>
            <!-- Default host name -->
            <parameter>${jboss.bind.address}</parameter>
            <!-- The port offset -->
            <parameter>700</parameter>
            <!-- Set of bindings to which the "offset by X" approach can't be applied -->
            <parameter><null/></parameter>
         </constructor>
      </bean>
  
      <!-- The ports-08 bindings are obtained by taking ports-default and adding 800 to each port value -->
      <bean name="Ports08Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
         <constructor>
            <!--  The name of the set -->
            <parameter>ports-08</parameter>
            <!-- Default host name -->
            <parameter>${jboss.bind.address}</parameter>
            <!-- The port offset -->
            <parameter>800</parameter>
            <!-- Set of bindings to which the "offset by X" approach can't be applied -->
            <parameter><null/></parameter>
         </constructor>
      </bean>
  
      <!-- The ports-09 bindings are obtained by taking ports-default and adding 900 to each port value -->
      <bean name="Ports09Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
         <constructor>
            <!--  The name of the set -->
            <parameter>ports-09</parameter>
            <!-- Default host name -->
            <parameter>${jboss.bind.address}</parameter>
            <!-- The port offset -->
            <parameter>900</parameter>
            <!-- Set of bindings to which the "offset by X" approach can't be applied -->
            <parameter><null/></parameter>
         </constructor>
      </bean>


  <!-- Base binding metadata that ServiceBindingStore uses to create bindings for each set -->
    <bean name="StandardBindings" class="java.util.HashSet">
       <constructor>
          <parameter class="java.util.Collection">
             <set elementClass="org.jboss.services.binding.ServiceBindingMetadata">
             <!-- ********************* conf/jboss-service.xml ****************** -->

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

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=Naming</property>
                <property name="bindingName">RmiPort</property>
                <property name="port">1098</property>
                <property name="description">Socket Naming service uses to receive RMI requests from client proxies</property>
             </bean>

             <!-- Remote classloading service -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=WebService</property>
                <property name="port">8083</property>
                <property name="description">Socket for dynamic class and resource loading</property>
             </bean>

             <!-- Remoting Connector -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">UnifiedInvokerConnector</property>
                <property name="port">4446</property>
                <property name="description">Socket for JBoss Remoting Connector used by UnifiedInvoker</property>
             </bean>
            
             <!-- Used to create a multihome Remoting server.   See -->
             <!-- deploy/remoting-jboss-beans.xml for more details. -->
             <!--bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">UnifiedInvokerConnector:bindingHome1</property>
                <parameter>192.168.2.2</property>
                <property name="port">7777</property>
                <property name="description">Socket for JBoss Remoting Connector used by UnifiedInvoker on a multihome server</property>
             </bean-->
            
             <!-- Used to create a multihome Remoting server.   See -->
             <!-- deploy/remoting-jboss-beans.xml for more details. -->
             <!--bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">UnifiedInvokerConnector:bindingHome2</property>
                <parameter>10.11.12.238</property>
                <property name="port">8888</property>
                <property name="description">Socket for JBoss Remoting Connector used by UnifiedInvoker on a multihome server</property>
             </bean-->

             <!-- ********************* deploy/legacy-invokers-service.xml ****************** -->

             <!-- RMI/JRMP invoker -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=invoker,type=jrmp</property>
                <property name="port">4444</property>
                <property name="description">Socket for the legacy RMI/JRMP invoker</property>
             </bean>

             <!-- Pooled invoker -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=invoker,type=pooled</property>
                <property name="port">4445</property>
                <property name="description">Socket for the legacy Pooled invoker</property>
             </bean>

             <!-- ********************* deploy/cluster/hajndi-service.xml ****************** -->

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=HAJNDI</property>
                <property name="bindingName">Port</property>
                <property name="port">1100</property>
                <property name="description">The listening socket for the HA-JNDI service</property>
             </bean>

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=HAJNDI</property>
                <property name="bindingName">RmiPort</property>
                <property name="port">1101</property>
                <property name="description">Socket HA-JNDI service uses to receive RMI requests from client proxies</property>
             </bean>

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=HAJNDI</property>
                <property name="bindingName">AutoDiscovery</property>
                <property name="hostName">${jboss.partition.udpGroup:230.0.0.4}</property>
                <property name="port">1102</property>
                <property name="description">Multicast socket on which HA-JNDI listens for auto-discovery requests from clients</property>
                <!-- This address should not be changed between different
                     binding sets; all nodes need to listen on the same
                     multicast address -->
                <property name="fixedHostName">true</property>
                <!-- This port should not be changed between different
                     binding sets; all nodes need to listen on the same port -->
                <property name="fixedPort">true</property>
             </bean>

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=HAJNDI</property>
                <property name="bindingName">AutoDiscoveryInterface</property>
                <property name="hostName">${jboss.bind.address}</property>
                <property name="description">Interface for multicast socket on which HA-JNDI listens for auto-discovery requests from clients</property>
             </bean>

             <!-- ********************* deploy/cluster/ha-legacy-service.xml ****************** -->

             <!-- HA RMI/JRMP invoker -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=invoker,type=jrmpha</property>
                <property name="port">4447</property>
                <property name="description">Socket for high availability version of the legacy RMI/JRMP invoker</property>
             </bean>

             <!-- HA Pooled invoker -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=invoker,type=pooledha</property>
                <property name="port">4448</property>
                <property name="description">Socket for high availability version of the legacy Pooled invoker</property>
             </bean>

             <!-- ********************* deploy/iiop-service.xml ****************** -->

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=CorbaORB</property>
                <property name="port">3528</property>
                <property name="description">IIOP socket for the Corba ORB</property>
             </bean>

             <!-- ********************* deploy/snmp-adaptor.sar **************** -->

             <!-- Trap receiver that acts as an SNMP Manager -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss.jmx:name=SnmpAgent,service=trapd,type=logger</property>
                <property name="port">1162</property>
                <property name="description">Socket for the SNMP trap receiver</property>
             </bean>

             <!-- The SNMP adaptor MBean -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss.jmx:name=SnmpAgent,service=snmp,type=adaptor</property>
                <property name="port">1161</property>
                <property name="description">Socket for the SNMP adaptor MBean</property>
             </bean>

             <!-- ********************* deploy/jmx-remoting.sar **************** -->

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss.remoting:service=JMXConnectorServer,protocol=rmi</property>
                <property name="port">1090</property>
                <property name="description">RMI/JRMP socket for connecting to the JMX MBeanServer</property>
             </bean>

             <!-- ********************* deploy/ejb3-connectors-service.xml **************** -->

             <!-- EJB3 wants to have the service create its own ServiceBinding object
                  dynamically.  See the value-factory usage in deploy/ejb3-connectors-service.xml -->


             <!-- ********************* deploy/jbossweb.sar **************** -->
             <!-- ********************* deploy/httpha-invoker.sar **************** -->

             <!--
                 JBoss Web server.xml configuration.

                 Same binding config can be used by the following services, or really
                 anything else that needs to point to the JBoss Web HTTP connector
                 but doesn't need an XSL Transform

                 jboss:service=invoker,type=http
                 jboss:service=invoker,type=http,target=Naming
                 jboss:service=invoker,type=http,target=Naming,readonly=true
                 jboss:service=invoker,type=httpHA
                 jboss:service=invoker,type=http,target=HAJNDI
                 jboss.ws:service=ServiceEndpointManager
             -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss.web:service=WebServer</property>
                <property name="port">8080</property>
                <property name="description">JBoss Web HTTP connector socket; also drives the values for the HTTPS and AJP sockets</property>

                <!--
                    Inject a XSLT transform configuration (see below) that describes
                    how to transform server.xml
                    If the binding value request doesn't require an XSL Transform, this config
                    will be ignored.
                -->
                <property name="serviceBindingValueSourceConfig"><inject bean="JBossWebConnectorXSLTConfig"/></property>
             </bean>

             <!-- For services like those listed above that need to know the
                  port of the HTTPS connector -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss.web:service=WebServer</property>
                <property name="bindingName">HttpsConnector</property>
                <property name="port">8443</property>
                <property name="description">JBoss Web HTTPS connector socket</property>
             </bean>

             <!-- ********************* deploy/messaging/remoting-bisocket-service.xml ********************** -->

             <!-- Standard JBM bisocket connector -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss.messaging:service=Connector,transport=bisocket</property>
                <property name="port">4457</property>
                <property name="description">Socket for JBoss Messaging 1.x</property>
             </bean>

             <!-- ********************* JBoss Messaging 2 **************** -->

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                 <property name="serviceName">JBM2</property>
                 <property name="bindingName">netty-port</property>
                 <property name="port">5445</property>
                 <property name="description">Socket for JBoss Messaging 2.x</property>
             </bean>

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                 <property name="serviceName">JBM2</property>
                 <property name="bindingName">netty-ssl-port</property>
                 <property name="port">5446</property>
                 <property name="description">SSL socket for JBoss Messaging 2.x</property>
             </bean>

             <!-- ********************* deploy/transaction-jboss-beans.xml ********************** -->

             <!-- JBossTS Recovery Manager -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                 <property name="serviceName">TransactionManager</property>
                 <property name="bindingName">recoveryManager</property>
                 <property name="port">4712</property>
                 <property name="description">Socket for JBossTS Recovery Manager</property>
             </bean>

             <!-- JBossTS Transaction Status Manager -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                 <property name="serviceName">TransactionManager</property>
                 <property name="bindingName">transactionStatusManager</property>
                 <property name="port">4713</property>
                 <property name="description">Socket for JBossTS Transaction Status Manager</property>
             </bean>

             <!-- JBossTS SocketProcessId.  The address part is ignored,
                 it will always use localhost/127.0.0.1. -->
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                 <property name="serviceName">TransactionManager</property>
                 <property name="bindingName">socketProcessId</property>
                 <property name="port">4714</property>
                 <property name="description">Socket used to provide unique process id for JBossTS. The address configuration is ignored; will always use localhost/127.0.0.1</property>
             </bean>

             <!-- ********************* deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml **************** -->
            
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                 <property name="serviceName">ModClusterService</property>
                 <property name="bindingName">AdvertiseGroup</property>
                 <property name="hostName">${jboss.mod_cluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property>
                 <property name="port">${jboss.mod_cluster.advertise.port:23364}</property>
                 <property name="description">Multicast address/port on which to listen for mod_cluster proxy advertisements</property>
                 <!-- This address should not be changed between different
                      binding sets; all nodes need to listen on the same
                      multicast address -->
                 <property name="fixedHostName">true</property>
                 <!-- This port should not be changed between different
                      binding sets; all nodes need to listen on the same port -->
                 <property name="fixedPort">true</property>
             </bean>

             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">ModClusterService</property>
                <property name="bindingName">AdvertiseGroupInterface</property>
                <property name="hostName">${jboss.bind.address}</property>
                <property name="description">Interface for multicast socket on which to listen for mod_cluster proxy advertisements</property>
             </bean>

             <!-- ********************* deploy/hsqldb-ds.xml **************** -->

             <!-- Commented out as tcp/ip access to Hypersonic is not enabled by default -->
             <!--
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=Hypersonic</property>
                <property name="port">1701</property>
                <property name="description">TCP/IP socket for remote connection to Hypersonic database</property>
             </bean>
             -->

             <!-- ********************* JBoss MQ **************** -->

             <!-- Commented out as JBoss MQ is not installed by default
                  If you uncomment this and also use jboss.mq:service=InvocationLayer,type=HTTP,
                  configure the http invocation layer using the jboss.web:service=WebServer binding above
              -->
             <!--
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss.mq:service=InvocationLayer,type=UIL2</property>
                <property name="port">8093</property>
                <property name="description">UIL2 socket for JBossMQ</property>
             </bean>
             -->
          </set>
          </parameter>
       </constructor>
    </bean>

    <!-- Conversion of selected bindings into system properties -->
    <bean name="SystemPropertyBinder" class="org.jboss.services.binding.SystemPropertyBinder">

       <constructor>
          <parameter>
             <set>
                <!-- JBM's remoting connector -->
                <bean class="org.jboss.services.binding.SystemPropertyBinding">
                   <constructor>
                      <parameter>jboss.messaging.connector.bisocket.port</parameter>
                      <parameter class="int">
                         <value-factory bean="ServiceBindingManager" method="getIntBinding"
                                        parameter="jboss.messaging:service=Connector,transport=bisocket"/>
                      </parameter>
                   </constructor>
                </bean>
                <!-- JBM2 netty connector -->
                <bean class="org.jboss.services.binding.SystemPropertyBinding">
                   <constructor>
                      <parameter>jbm.remoting.netty.port</parameter>
                      <parameter class="int">
                         <value-factory bean="ServiceBindingManager" method="getIntBinding">
                              <parameter>JBM2</parameter>
                              <parameter>netty-port</parameter>
                         </value-factory>
                      </parameter>
                   </constructor>
                </bean>
                <!-- JBM2 netty ssl connector  -->
                <bean class="org.jboss.services.binding.SystemPropertyBinding">
                   <constructor>
                      <parameter>jbm.remoting.netty.ssl.port</parameter>
                      <parameter class="int">
                         <value-factory bean="ServiceBindingManager" method="getIntBinding">
                              <parameter>JBM2</parameter>
                              <parameter>netty-ssl-port</parameter>
                         </value-factory>
                      </parameter>
                   </constructor>
                </bean>
             </set>
          </parameter>
       </constructor>

    </bean>

    <!-- XSL Transform to apply to server.xml -->
    <bean name="JBossWebConnectorXSLTConfig"
          class="org.jboss.services.binding.impl.XSLTServiceBindingValueSourceConfig">

       <constructor>
           <parameter><![CDATA[
    <xsl:stylesheet
          xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

      <xsl:output method="xml" />
      <xsl:param name="port"/>

      <xsl:variable name="portAJP" select="$port - 71"/>
      <xsl:variable name="portHttps" select="$port + 363"/>

      <xsl:template match="/">
        <xsl:apply-templates/>
      </xsl:template>

       <xsl:template match = "Connector">
          <Connector>
             <xsl:for-each select="@*">
             <xsl:choose>
                <xsl:when test="(name() = 'port' and . = '8080')">
                   <xsl:attribute name="port"><xsl:value-of select="$port" /></xsl:attribute>
                </xsl:when>
                <xsl:when test="(name() = 'port' and . = '8009')">
                   <xsl:attribute name="port"><xsl:value-of select="$portAJP" /></xsl:attribute>
                </xsl:when>
                <xsl:when test="(name() = 'redirectPort')">
                   <xsl:attribute name="redirectPort"><xsl:value-of select="$portHttps" /></xsl:attribute>
                </xsl:when>
                <xsl:when test="(name() = 'port' and . = '8443')">
                   <xsl:attribute name="port"><xsl:value-of select="$portHttps" /></xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                   <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>
                </xsl:otherwise>
             </xsl:choose>
             </xsl:for-each>
             <xsl:apply-templates/>
          </Connector>
       </xsl:template>

      <xsl:template match="*|@*">
        <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
      </xsl:template>
    </xsl:stylesheet>
    ]]>
           </parameter>
       </constructor>
    </bean>

 </deployment>

Step 4 : Deploy the application you want to run in this server.

Step 5: Re-start the server.



References:

1.       ServiceBindingManager in JBoss http://community.jboss.org/thread/65221