You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Константин Шумай <ko...@gmail.com> on 2008/01/25 08:56:25 UTC

jmxproxy server management problem

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

Re: jmxproxy server management problem

Posted by Tim Funk <fu...@joedog.org>.
I just checked again - there is no way to invoke an action with the 
jmxproxy. Just set/get values.

This can be done via JMX, just not the jmxproxy servlet. So if you allow 
tomcat to be monitored via a real JMX tool - you should be able to do this.

-Tim

Константин Шумай wrote:
> Tim, thanks for explanation. But I do not understand what for this
> functionality. Can you give me advice how to change server port on running
> server or restart Connector pogrammatically? nI have an aim to change server
> port. I do not find any information how to do this making use of Tomcats
> management tools or any other way.
> 
> 2008/1/25, Tim Funk <fu...@joedog.org>:
>> All you did was change the bean which contains the property. Now that
>> the port property is 8081. You need to stop the Connector and restart
>> it. I'm not sure if you can do this via the JMXProxy servlet. (Or if you
>> can - if there are any odd unexpected side effects)
>>
>> -Tim
>>
>> Константин Шумай wrote:
>>> 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


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jmxproxy server management problem

Posted by Константин Шумай <ko...@gmail.com>.
Tim, thanks for explanation. But I do not understand what for this
functionality. Can you give me advice how to change server port on running
server or restart Connector pogrammatically? nI have an aim to change server
port. I do not find any information how to do this making use of Tomcats
management tools or any other way.

2008/1/25, Tim Funk <fu...@joedog.org>:
>
> All you did was change the bean which contains the property. Now that
> the port property is 8081. You need to stop the Connector and restart
> it. I'm not sure if you can do this via the JMXProxy servlet. (Or if you
> can - if there are any odd unexpected side effects)
>
> -Tim
>
> Константин Шумай wrote:
> >
> > 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".
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: jmxproxy server management problem

Posted by Tim Funk <fu...@joedog.org>.
All you did was change the bean which contains the property. Now that 
the port property is 8081. You need to stop the Connector and restart 
it. I'm not sure if you can do this via the JMXProxy servlet. (Or if you 
can - if there are any odd unexpected side effects)

-Tim

Константин Шумай wrote:
> 
> 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".


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org