Running JBoss on a port other than 8080

Posted on Thursday, February 4, 2010

0


JBoss by default executes on port 8080. There are other hell lot of services which are run on different ports. JBoss provides an easy way of doing that. There is a file called bindings-jboss-beans.xml at the following location

/Softwares/jboss-5.1.0.GA/server/default/conf/bindingservice.beans/META-INF

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

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

         <!-- Base binding <span class="hiddenSpellError" pre="binding ">metadata</span> that is used to create bindings for each set -->
         <parameter><inject bean="StandardBindings"></inject></parameter>

      </constructor>

This helps in offsetting all the ports by 100 because of the following

 <!-- The ports-01 bindings <span class="hiddenGrammarError" pre="bindings ">are obtained</span> 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 <span class="hiddenGrammarError" pre="approach ">can't be</span> applied -->
         <parameter><null></null></parameter>
      </constructor>
   </bean>

so instead of the default http://localhost:8080, now the app server would be running on http://localhost:8180

Advertisements
Posted in: Java