A common problem that I encounter is the need to configure JBoss to work on a different set of ports. If for some reason the environment is already using port 1099 and 1100, 8080 is not available, etc, then I have to change the ports JBoss is running on. The hard way of solving this problem is by changing all the ports manually. That means editing all the JBoss service configurations and changing the ports there. This process is almost impossible considering how many configuration files and ports are involved. Not only that, your configurations need to match between files. It can really be a nightmare.
Thankfully there is another solution. JBoss has a Binding Manager service. You can configure this service to bind ports defined in a configuration file. JBoss also provides a sample configuration file with 4 sets of ports. In order to use this service you need to do the following (JBOSS_HOME represents the directory where JBoss is installed and SERVER_NAME represents the server instance you are working with):
1) Find sample-bindings.xml . It is usually located at /JBOSS_HOME/docs/examples/binding-manager/ . If you can't find it there, download JBoss and it will be in that zip file.
2) Copy that file to /JBOSS_HOME/server/SERVER_NAME/conf/ . I like to rename the file to bindings.xml, but that is up to you. The rest of the tutorial assumes you did not rename the file.
2) Enable the binding manager service. Open /JBOSS_HOME/server/SERVER_NAME/conf/jboss-service.xml. In that file uncomment the following section and make the change indicated in red:
<mbean code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute name="ServerName">ports-01</attribute>
<attribute name="StoreURL">${jboss.server.home.dir}/conf/sample-bindings.xml</attribute>
<attribute name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
</mbean>
Note that we changed StoreURL to point to the file you copied over. The other important attribute here is ServerName. ServerName specifies the set of ports to use from sample-bindings.xml. You can find the different servers names in sample-bindings.xml by searching for:
<server name
Bellow each of the server name tags you will find the port definitions. The options for the ServerName attribute with the default content of sample-bindings.xml are:
- ports-default
- ports-01
- ports-02
- ports-03
Look into sample-bindings to see to what ports each of those configurations binds to.
3) Save jboss-service.xml and restart JBoss. Now JBoss should be binding to the set of ports defined by ports-01.
An extra feature of this mechanism is in the fact that you can easily create your own set of custom ports to run JBoss on. Just copy everything from <server name="ports-01"> to </server> and attach it to sample-bindings, change the name attribute and you are ready to change that configuration to your heart's content. Then simply specify the name of that configuration in the ServerName attribute of the binding manager service (in jboss-service.xml).
It also resolves the issue of multiple instances of JBOSS
Posted by: Prasanth | July 09, 2008 at 12:16 AM
Thank you for posting this. It was exactly what I was looking for when trying to run JBoss AS and portal server on the same host for the first time. Cheers
Posted by: Tommy | October 01, 2008 at 01:45 AM
Thank you very much for helpful information.
Posted by: Jukka | February 18, 2009 at 05:09 AM
What about shutting down the second instance?
I've tried shutdown.sh specifying -Djboss.service.binding.set as a parameter, but it still shuts down the first instance.
Posted by: www.facebook.com/profile.php?id=567062661 | September 17, 2009 at 02:14 PM
How does that work for jboss 5? As far as I can see it is different there: http://community.jboss.org/wiki/AS5ServiceBindingManager
Posted by: joergf | June 26, 2010 at 01:15 AM
Tomorrow is an other day!@
Posted by: Air Jordan | November 13, 2010 at 12:05 AM
Thank God that I have a good place to praise Him.
Posted by: ugg bailey button | November 15, 2010 at 06:43 PM
I did not discuss that particular issue!!
Posted by: moncler jackets | November 15, 2010 at 07:08 PM
Never too old to learn.*
Posted by: air max 90 | November 25, 2010 at 10:56 PM
There may be something you need.And they are cheap and high quality.You will like them.
Posted by: Wholesale Electronics | November 28, 2010 at 10:16 PM
For what? I can not see what i said here.
Posted by: Wholesale Electronics | November 28, 2010 at 10:21 PM
YES...TOURBLE IS FRIEND WE SHOULD FACE IT NEW AND FUTURE.O(∩_∩)O~
Posted by: UGG Bailey Button Boots | January 17, 2011 at 01:43 AM
i agree with your views from here.
Posted by: Nike Air Max | April 20, 2011 at 08:26 PM
Thankfully there is another solution. JBoss has a Binding Manager service. You can configure this service to bind ports defined in a configuration file. JBoss also provides a sample configuration file with 4 sets of ports. In order to use this service you need to do the following (JBOSS_HOME represents the directory where JBoss is installed and SERVER_NAME represents the server instance you are working with
Posted by: flexible led strips | May 20, 2011 at 02:29 AM
so good
Posted by: Dr Dre Solo | October 24, 2011 at 01:24 AM