This post has been converted into a HOWTO document, which covers JBoss 4.x and 5.x. See HOWTO: Change Port Numbers in JBoss for more information.Port number assignments in JBoss application server 4.0 can be managed through the use of the Bindings Manager. The JBoss Bindings Manager can be loaded as part of jboss-service.xml for your server instance. For the example in this article, I will use the jboss-service.xml from the "default" server instance.
Remove the comments surrounding the Binding Manager configuration from your server's jboss-service.xml so that the following is displayed:
Note that the
ServerNameparameter is utilizing
ports-01. Note also that the
StoreURLparameter is presently pointing to a sample configuration file. Open that file up in your editor now. This file contains four port configuration sections. Each port is incremented by 100 from the previous set of ports. For example, the default ajp port is 8009. The port number assigned to this set in the
ports-01configuration is 8109, the number assigned in the
ports-02configuration is 8209, etc. The default http port is 8080. This is set to 8180 in the
ports-01configuration, 8280 in the
ports-02configuration—you get the idea.
Save this file to your server's conf directory as binding-manager.xml(same location as jboss-service.xml). You do not need to make any changes to this file for this example.
Modify your server instance's jboss-service.xml file and change the StoreURL configuration in the binding manager section from:
Start up your server and it is now listening on the set of ports from the
ports-01section of the binding-manager.xml file. If you are running JBoss on Windows, depending upon the service wrapper you are using, you might have to delete the service and re-create it. I've seen some service wrappers (like the one that ships with some versions of Covalent Enterprise Ready Server for tomcat) that does not re-read configuration updates unless the service is removed and re-installed.