tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schuerig <>
Subject Re: Making a webapp JMX-manageable?
Date Sun, 02 Jan 2005 23:53:50 GMT
On Monday 03 January 2005 00:31, Patrick Lacson wrote:
> Here's a link to sample code for integrating tomcat 5.5.4

Patrick, thanks for your link. I don't currently intend to embed Tomcat, 
just make an app running within Tomcat manageable. The latter I figured 
out, among other things, through an out-of-band discussion with Peter 
Rossbach. I can't offer a completely general solution, though.

I'm using the Spring framework ( and had 
a look at the JMX support classes that are currently in the CVS sandbox 
directory. I found that, amazingly, with their help I could expose 
attributes and operations of my app to JMX without writing any code. 
All that is required are some declarations in the application context 
file (applicationContext.xml).

Create an MBeanServer registered as a bean

  <bean id="mbeanserver"
    <property name="defaultDomain"><value>MyDomain</value></property>

Wrap an MBean adapter around my repositorymanager bean (not shown), 
which is a completely ordinary java object. In this case, public 
methods are exposed as attributes/operations. Alternatively, metadata  
can be used.

  <bean id="mbeanadapter"
    <property name="server"><ref bean="mbeanserver"/></property>
    <property name="beans">
        <entry key="MyDomain:id=Repository">
          <ref bean="repositorymanager"/>

Create a connector listening, by default, on 
service:jmx:jmxmp://localhost:9876 (this requires 

  <bean id="jmxconnector"
    <property name="server"><ref bean="mbeanserver"/></property>

Maybe this was of interest to anyone...


Michael Schuerig                            This is not a false alarm                         This is not a test                      --Rush, Red Tide

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message