JBoss Ports

Why configure JBoss's Ports?

Configuring port numbers in JBoss can seem a little complicated, but it's actually pretty easy to understand once you get how JBoss is configured. However, why bother spending the time learning all this if it isn't going to be useful? Here are a few reasons why you might want to configure JBoss ports:

  1. You are running an instance of Tomcat on your machine already, and you can't start JBoss because port 8080 is already in use.
  2. You have a team of developers sharing a deployment machine. Each developer needs their own instance of JBoss (Note: if so, you will want to look at Shared JBoss Installation Directory also)
  3. A testing team wants to test different versions of the application using the same machine.
  4. You are planning on deploying more than one JBoss JVM per machine in a cluster to get higher availability and better performance (lots of smaller JVMs).

JBoss 4.x Ports

Here are the ports used by JBoss 4.x:

Default port numbers and where they are configured

Default Port Location Description
./conf/jboss-service.xml or ./naming.sar/META-INF/jboss-service.xml Bootstrap JNP port.
1098 (anon) ./conf/jboss-service.xml or ./naming.sar/META-INF/jboss-service.xml RMI naming service port.
Use '0' for an anonymous port.
4444 ./conf/jboss-service.xml or ./deploy/invokers-service.xml RMI/JRMP invoker port
4445 ./conf/jboss-service.xml or ./deploy/invokers-service.xml Pooled invoker
8083 ./conf/jboss-service.xml or ./deploy/dynclassloader-service.xml RMI dynamic class loader port
8080 ./deploy/jbossweb-tomcat55.sar/server.xml HTTP port for the web container
8009 ./deploy/jbossweb-tomcat55.sar/server.xml AJP port for the web container
8093 ./deploy/jms/uil2-service.xml UIL for JMS.
8443 (optional) ./deploy/jbossweb-tomcat55.sar/server.xml HTTPS port for the web container

Additional port numbers for clustered configurations

Default Port Location Description
./deploy/cluster-service.xml HA-JNDI
1101 (anon) ./deploy/cluster-service.xml RMI for HA-JNDI
Use '0' for an anonymous port.
4446 ./deploy/cluster-service.xml HA Pooled Invoker
4447 ./deploy/cluster-service.xml HA JRMP
45566 (mcast) ./deploy/cluster-service.xml JGroups clustering

Other ports for optional services

Default Port Location Description
3528 ./deploy/iiop-service.xml CORBA port
3873 ./deploy/ejb3.deployer/META-INF/jboss-service.xml EJB3 remote invoker
1162 ./deploy/snmp-adaptor.sar/META-INF/jboss-service.xml SNMP Log
1161 ./deploy/snmp-adaptor.sar/META-INF/jboss-service.xml SNMP Adaptor
19001 jmx-rmi-adaptor.sar JMX over RMI

How to configure ports for different instances of JBoss

Solution #1 : Use the Service Binding facility

The "Service Binding" feature uses a JMX bean to configure the other JMX beans (as far as I can tell). This requires you to make a file that has all of the possible bindings for each 'jboss server name'. The basics are:

  1. Create a globally shared "Service Binding" file that will contain the port numbers for each possible instance of JBoss on the machine by 'configuration name'.
  2. Uncomment or add a "Service Binding" section in conf/jboss-service.xml. This where the configuration will select which set of bindings it will use from the shared bindings file.

See: http://community.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOnemachine

Solution #2: Use M4 or ANT to pre-process the XML configuration files.

If JBoss isn't the only thing that needs port numbers, host names and directories configured into each instance than you need more than just the Service Binding feature. In this case, we experience one drawback of JBoss's modular configuration: there are lots of files to change! Although this isn't really that difficult it requires a bit of work and it might break if JBoss changes their configuration files around if you're not careful.

Solution #3 (the best of both) : Use a combination of Service Binding and [ANT] or M4

The answer to the drawbacks of solutions #1 and #2: Use both! If you use substitution on the service binding configuration file itself then it is as if all JBoss ports are configured in one file. This means you don't have to process each individual configuration file. The basic idea here is to create a service binding XML file that has the substitutable tokens in it, and use [ANT] or M4 to process this one file.

Mapping the EJB3 Remote Invoker Port

The example port bindings file doesn't map the EJB3 remoting port. This is easy:

socket://$\{jboss.bind.address\}:3873

Just replace '3873' with the port number you want to use.

What ports is JBoss Listening on?

On Linux, you can use:

 $ lsof -p \{jboss pid\} | grep TCP

Links

Labels

jboss jboss Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.