5 Replies Latest reply: Apr 17, 2007 4:17 PM by rmorgan_hyperic RSS

HQ fails to monitor Tomcat when some JMX attributes contain dots ('.')

nickbr_hyperic Hot Shot
Currently Being Moderated
We have an application that exposes configuration properties as read-only JMX attributes, some of which contain dots -- path.to.something for example.

In this case, the response from /hyperic-hq/jmx-attributes?qry=* will look like:
...
Name: ...
path.to.something: ...
...

This, in turns, causes HQ agent to fail parsing the response:
2007-03-18 22:46:22,139 DEBUG [MeasurementCommandsServer] Error getting real tim
org.hyperic.hq.product.MetricInvalidException: Incorrect response from monitored
        at org.hyperic.hq.product.servlet.client.JMXRemote.refresh(JMXRemote.jav
        at org.hyperic.hq.product.servlet.client.JMXRemote.getRemoteInfo(JMXRemo
        at org.hyperic.hq.product.servlet.client.JMXRemote.getValue(JMXRemote.ja
        at org.hyperic.hq.product.servlet.client.JMXRemote.getRemoteMBeanValue(J
        at org.hyperic.hq.plugin.servlet.ServletMeasurementPlugin.getRemoteValue
        at org.hyperic.hq.plugin.servlet.ServletMeasurementPlugin.getValue(Servl
        at org.hyperic.hq.product.MeasurementPluginManager.getPluginValue(Measur
        at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementP
        at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementP
        at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementP
        at org.hyperic.hq.measurement.agent.server.MeasurementCommandsServer.get
        at org.hyperic.hq.measurement.agent.server.MeasurementCommandsServer.dis
        at org.hyperic.hq.agent.server.CommandDispatcher.processRequest(CommandD
        at org.hyperic.hq.agent.server.CommandListener.listenLoop(CommandListene
        at org.hyperic.hq.agent.server.AgentDaemon.start(AgentDaemon.java:680)
        at org.hyperic.hq.agent.server.AgentDaemon$RunnableAgent.run(AgentDaemon
        at org.hyperic.hq.agent.server.AgentDaemon.main(AgentDaemon.java:762)
Caused by: java.io.IOException: invalid header field name: path.to.something
        at java.util.jar.Attributes.read(Attributes.java:409)
        at java.util.jar.Manifest.read(Manifest.java:219)
        at java.util.jar.Manifest.<init>(Manifest.java:52)
        at org.hyperic.hq.product.servlet.client.JMXRemote.refresh(JMXRemote.jav
        ... 16 more

This is against HQ 3.0.2.

My proposed patch is:

*** JMXServlet.java.orig        2007-03-18 23:01:38.000000000 -0400
--- JMXServlet.java     2007-03-19 00:10:39.000000000 -0400
***************
*** 346,351 ****
--- 346,352 ----
                              Object o = mServer.getAttribute(oname, attName);
                              if(attName.indexOf( "=") >=0 ||
                                 attName.indexOf( ":") >=0 ||
+                                attName.indexOf( ".") >=0 ||
                                 attName.indexOf( " ") >=0 ) {
                                  continue;
                              }

More Like This

  • Retrieving data ...

Share This Page