3 Replies Latest reply on Jun 4, 2011 6:12 AM by skiefer

    Changing the Port number in Jboss 6

    kalpanadodda

      where can i change the Http port no in jboss6.

      when ever i chnaged the Http  port no avialbale in JbossHome\server\all\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml file and run the server i got binding exception.

        • 1. Changing the Port number in Jboss 6
          wdfink

          you might start JBoss and set '-Djboss.service.binding.set=ports-01' to change all port numbers +100.

          But if you want to change not all ports you might change the 8080 port to what you want.

           

          If this will not work please provide your change and the server/boot.log

          • 2. Changing the Port number in Jboss 6
            dmanyemwe

            You can add a connector to your /server/[config]/deploy/jbossweb.sar/server.xml. On restarting JBoss will bind the specified protocol on the new port, eg:

             

            <Connector protocol="HTTP/1.1" port="11111" address="${jboss.bind.address}"

                           connectionTimeout="20000" keepAliveTimeout="15000"/>

            • 3. Re: Changing the Port number in Jboss 6
              skiefer

              this only changes the http-port. But there are other Ports which could be affected. Better to use the jboss native port-bindings your prefered server congigs (usaly default).

               

              Change File: /jboss/servers/<yourServer>/conf/bindingservice.beans/META-Inf/bindings-jboss-beans.xml

               

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

              <!-- Insert injection of your own Configuration e.g. -->

                             <inject bean="Ports<yourCustomName>Bindings"/>

                          </set>

                       </parameter>

               

                       <!-- Base binding metadata that is used to create bindings for each set -->

                       <parameter><inject bean="StandardBindings"/></parameter>

               

                    </constructor>

                 </bean>

               

              And add an entry after the native settings:

               

                 <!-- The ports-Custom bindings are obtained by taking ports-default and adding 12000 to each port value -->

                 <bean name="Ports<yourCustomName>Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">

                    <constructor>

                       <!--  The name of the set -->

                       <parameter>ports-<yourCustomName></parameter>

                       <!-- Default host name -->

                       <parameter>${jboss.bind.address}</parameter>

                       <!-- The port offset -->

                       <parameter><YourOffsetValue></parameter>

                       <!-- Set of bindings to which the "offset by X" approach can't be applied -->

                       <parameter><null/></parameter>

                    </constructor>

                 </bean>

               

              If you set in custom for <yourCustomName> and for example 2000 for <YourOffsetValue> you can run JBoss6:

               

              ./run.sh -Djboss.service.binding.set=ports-custom

               

              Now your instance use all ports+2000 (e.g. http-->port 10080)

               

              If one need more control of the ports he/she might change all ports in this file as needed, which I woul avoid.