Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does JBoss choose which AJP port to use?

Tags:

jboss5.x

ajp

In JBoss 5.1.0, there is a file called <INSTANCE>/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml which includes some settings for applying an offset to the port numbers. This is used to enable multiple instances to run on the same box without going through painful reconfiguration of the ports for each instance. There is also some XSLT in the same file which also modifies the AJP port.

In addition, there is <INSTANCE>/deploy/jbossweb.sar/server.xml which lets you set the ports explicitly.

I am running two instances of JBoss on the same box.

  • Instance 1: server.xml is set to use port 8009 for AJP, and bindings-jboss-beans.xml has a zero offset.
  • Instance 2: server.xml is set to use port 8109 for AJP, and bindings-jboss-beans.xml has an offset of 100.

The XSLT seems to be configured to change the AJP port number when the port is set to be the default (8009). However, that doesn't seem to be happening.

From what I can see, the AJP port is chosen by the value in server.xml rather than any value in bindings-jboss-beans.xml. Is this definitely the case? Is the XSLT inside bindings-jboss-beans.xml a relic from JBoss 4?

Thanks

Rich

like image 353
Rich Avatar asked Nov 05 '22 10:11

Rich


1 Answers

I finally got round to running a few experiments, and can now answer my own question.

If the port is set to 8009 in server.xml, then the offset in bindings-jboss-beans.xml is applied, otherwise the port set in server.xml is used.

like image 73
Rich Avatar answered Nov 22 '22 13:11

Rich