HomeIndex > FAQ > Admin questions > How to change port numbers for Geronimo services

Geronimo's configuration file is var/config/config.xml. It contains port numbers for Geronimo services amongst other things.

XMLsolidvar/config/config.xml ... <ns2:module name="org.apache.geronimo.configs/j2ee-security/2.1-SNAPSHOT/car"> <ns2:gbean name="JMXService"> <ns2:attribute name="protocol">rmi</ns2:attribute> <ns2:attribute name="host">${ServerHostname}</ns2:attribute> <ns2:attribute name="port">${JMXPort + PortOffset}</ns2:attribute> <ns2:attribute name="urlPath">/jndi/rmi://${ServerHostname}:${NamingPort + PortOffset}/JMXConnector</ns2:attribute> </ns2:gbean> </ns2:module> ...

As you might've noticed, the port number of the JMXService service (the port attribute) is specified indirectly using a sort of variable, e.g. ${JMXPort + PortOffset}. When Geronimo starts up it reads the configuration file - var/config/config.xml and applies var/config/config-substitutions.properties to it.

Below you can see the attribute values for org.apache.geronimo.configs/j2ee-security/2.1-SNAPSHOT/car module (whose configuration has been shown above).

Javasolidvar/config/config-substitutions.properties ServerHostname= JMXPort=9999 PortOffset=0 NamingPort=1099

If you need to change the port number for a service, just change the var/config/config-substitutions.properties and voila it will be picked up the next time Geronimo starts up.

You need to be careful while introducing changes to Geronimo configuration as you might run into issues with ports out of range, i.e. when ${JMXPort + PortOffset} is greater than the upper limit for a port number which is 65k.