Hello All,
I am connecting to tomcat over JMX. I wrote a simple JMX client to connect to
tomcat and read different JMX MBean attributes to monitor tomcat. My problem is, I would like to know which port tomcat's HTTP connector is listenting. Is there a way to get this details over JMX Mbean - without reading the server.xml file of tomcat. But to get it thru some attributes of one MBean ?
views:
984answers:
2
A:
The MBean is called something like Catalina:type=ThreadPool,name=http-8080
. As you can see the connector port is in the name.
Kees de Kooter
2009-03-17 15:18:29
If the tomcat is not running on 8080, and it is running on 9090 - then the name of the bean will become Catalina:type=ThreadPool,name=http-9090. In that case, I need to know which port the http connector is running.
Shamik
2009-03-17 15:35:19
In that case it is running on port 9090. The name of the threadpool reflects the port of the http conector.
Kees de Kooter
2009-03-17 19:52:01
Probably one stupid question - but my question is - is there any way to know the names of the beans programatically that tomcat exposes ?
Shamik
2009-03-18 04:10:00
You can use the JConsole utility to inspect all MBeans of a running application.
Kees de Kooter
2009-03-18 07:33:35
You can get a list of MBeans matching various criteria using the `MBeanServerConnection.queryNames()` method. For example, `queryNames(new ObjectName("Catalina:type=ThreadPool,*", null))` should return a list of all the `ThreadPool` MBeans.
Matt Solnit
2009-12-16 00:05:06
A:
Shamik, I'm trying to create a community resource to help everyone learn how to connect tomcat jmx but right now there is no content. Please contribute!