PDA

View Full Version : JMX attributes do not appear on Tomcat


JongKim
Dec 19th, 2005, 03:12 PM
I'm using Spring 1.2.2 with Tomcat 5.0.

I have the following JMX/MBean configuration in my application context file.

<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=presenceService">
<ref local="presenceService"/>
</entry>
</map>
</property>
<property name="assembler">
<bean class="org.springframework.jmx.export.assembler.MethodNam eBasedMBeanInfoAssembler">
<property name="methodMappings">
<map>
<entry key="bean:name=presenceService"><value>getJabberServer,getJabberServerPort,getEnable</value></entry>
</map>
</property>
</bean>
</property>
</bean>

When I deploy my app on JBoss 4.0.2 and point my browser to http://localhost:8080/web-console, I can see three attributes - getJabberServer, getJabberServerPort, getEnable - on the JMX console and the values of the attributes displayed there are correct.

However, when I deploy the same app/configuration on Tomcat 5.0, and point my browser to http://localhost:8080/manager/jmxproxy/?qry=*:*, I can only see the name of my JMX bean but not its attributes. The following two lines are all I got.

Name: bean:name=presenceService
modelerType: com.sitescape.ef.presence.impl.PresenceServiceImpl

All Tomcat JMX components themlselves are displayed correctly with their attribute values included.

Does anyone know why this discrepency? Any help would be appreciated.

JongKim
Dec 20th, 2005, 08:59 AM
To further investigate the problem, I added another bean that actually implements MBean interface (i.e., standard MBeans) and Tomcat displays the attributes of the bean without problem. So it appears that only the dynamic/model MBeans setup is not working. Does anyone know if this is a problem with Tomcat's JMX support?

Costin Leau
Jan 7th, 2006, 04:27 PM
What about Spring 1.2.6?

JongKim
Jan 31st, 2006, 10:30 AM
I just tried Spring 1.2.6, but still the same.

Costin Leau
Jan 31st, 2006, 03:10 PM
Can you please raise an issue on JIRA? It would help if you could provide a simple test/example that demonstrates the problem. Thanks.

wims.tijd
Aug 3rd, 2006, 06:51 AM
I encountered the same behaviour when i had to change the
JAVA_HOME for JBoss from 1.5 to 1.42 for production,
i've tried interface mappings,commons-attributes and method-based export
interface = attributes are all null
common-attributes = only the first attribute was shown with null value
method-based = the last method was exposed as an operation the rest as attributes with null value

with jdk 1.5 it worked fine.

wims.tijd
Aug 3rd, 2006, 08:37 AM
changed ManagedAttribute to ManagedOperation
now all metadata are exported under jdk142 with jboss327
when the operation is invoked the attribute value is returned