Hello all,

I've encountered interesting thing while working with Apache Tomcat 6.0.14.
I have clear aim: to change running server port number using the remote
application.

There is an ability described in Tomcat documentation which provides
administrative tools for server management. In particular JMX Proxy servlet
(
http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#JMX%20Set%20command<http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#JMX%2520Set%2520command>)
provides commands that use server
JMX MBeans to change its configuration.

There is an assertion in chapter Catalina Functional Specifications
http://tomcat.apache.org/tomcat-6.0-doc/funcspecs/fs-admin-apps.html): "To
the maximum extent feasible, Catalina components that offer direct
administrative APIs and property setters shall support "live" changes to
their operation, without requiring a container restart." JMX MBeans
components described like such API.

In chapter Tomcat MBean Names (
http://tomcat.apache.org/tomcat-6.0-doc/docs/funcspecs/mbean-names.html)
Connector MBean is mentioned. It corresponds to Server/Service/Connector
element of server.xml configuration file. Chapter "Administered Objects"
contains the list of configurable properties of Connector element
(http://tomcat.apache.org/tomcat-6.0-doc/funcspecs/fs-admin-objects.html#Connector

), and there is a property "port - TCP/IP port number on which this
Connector
should listen for incoming requests. [8080]".

My remote application named "myapp" (myapp.war) tries to change server port
number. The most interesting is that I receive beneficial reply "OK -
Attribute set". Does it mean that now I can work with my application on a
new port number without restarting server, for example old URL
http://localhost:8080/
<http://localhost:8080/jmx>myapp<http://localhost:8080/jmx>and new
http://localhost:8081/
<http://localhost:8081/jmx>myapp<http://localhost:8081/jmx>or my
understandings are wrong?

My application (myapp.war) consist of single html page, containing single
link to JMXProxyServlet -
<a
href="/manager/jmxproxy/?set=Catalina:type=Connector,port=8080&att=port&val=8081">Change
connector port to 8081</a>

After setting the new port number using JMX Proxy servlet I have executed
JMX
Query command to check my changes and received new port (8081) for MBean
"Catalina:type=Connector,port=8080".

My environment: Apache Tomcat/6.0.14, Windows 2000 x86, Java 1.6.0_03-b05,
IE 6.0

Any of your comments according this issue would be much appreciated.
Thank you in advance.

My best regards,
Konstantin

Reply via email to