I'm trying to get Hyperic to auto-discover some custom MBeans in my webapp (see code below).
I'm evaluating HQ Version 4.2.0.7-EE (build #1284 - Mar 24, 2010 - Release Build), in conjunction with a simple webapp built with Spring Framework 3.0.1.RELEASE. I've tried deploying the webapp in SpringSource tc Server as well as in Tomcat 6.0.26, with the same result in each case; Hyperic autodiscovers the servlet container but doesn't show my custom MBeans.
I followed the steps shown in http://support.hyperic.com/display/DOC/Model+MBean+Naming+and+Descriptor+Data#ModelMBeanNamingandDescriptorData-ModelMBeanObjectNameFormat to annotate my classes as @ManagedResource's.
My custom MBeans show up fine in JConsole (using the connection URL "service:jmx:rmi:///jndi/rmi://localhost:6969/jmxrmi"), but I can't get Hyperic to discover them.
My webapp is built with standard Spring 3.0.1, not instrumented Spring.
Here is the relevant code from one of the MBeans:
[code]
@ManagedResource(objectName = "spring.application:application=eservices, type=ResourcePool, name=httpClientPoolImpl",
description = "HTTP Client Pool")
public class HttpClientPoolImpl implements HttpClientPool {
....
@ManagedMetric(category = "utilization", displayName = "Number of clients available",
description = "The number of HTTP clients available in the pool",
metricType = MetricType.GAUGE, unit = "none")
public synchronized int getNumberOfClientsAvailable() {
return clientsAvailable;
}
[/code]
The following extract from the Hyperic agent's logfile shows that the autodiscoverer is throwing a NullPointerException:
[code]
2010-06-08 15:59:28,304 INFO [Thread-2] [RuntimeAutodiscoverer] Running runtime autodiscovery for SpringSource tc Runtime 6.0
2010-06-08 15:59:28,344 ERROR [Thread-2] [RuntimeAutodiscoverer] Unexpected error running autodiscoverer for plugin: SpringSource
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at org.hyperic.hq.product.PluginUpdater.addProperties(PluginUpdater.java:77)
at org.hyperic.hq.product.PluginUpdater.updatePluginData(PluginUpdater.java:84)
at org.hyperic.hq.product.PluginUpdater.updateServiceTypes(PluginUpdater.java:110)
at org.hyperic.hq.product.ServerDetector.discoverResources(ServerDetector.java:218)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan_internal(RuntimeAutodiscoverer.java:272)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan(RuntimeAutodiscoverer.java:205)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:165)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
[/code]
I'd appreciate any help I can get. The logfile indicates a bug in the Hyperic agent, but is this the reason for not discovering the MBeans?
Thanks
Rob
I'm evaluating HQ Version 4.2.0.7-EE (build #1284 - Mar 24, 2010 - Release Build), in conjunction with a simple webapp built with Spring Framework 3.0.1.RELEASE. I've tried deploying the webapp in SpringSource tc Server as well as in Tomcat 6.0.26, with the same result in each case; Hyperic autodiscovers the servlet container but doesn't show my custom MBeans.
I followed the steps shown in http://support.hyperic.com/display/DOC/Model+MBean+Naming+and+Descriptor+Data#ModelMBeanNamingandDescriptorData-ModelMBeanObjectNameFormat to annotate my classes as @ManagedResource's.
My custom MBeans show up fine in JConsole (using the connection URL "service:jmx:rmi:///jndi/rmi://localhost:6969/jmxrmi"), but I can't get Hyperic to discover them.
My webapp is built with standard Spring 3.0.1, not instrumented Spring.
Here is the relevant code from one of the MBeans:
[code]
@ManagedResource(objectName = "spring.application:application=eservices, type=ResourcePool, name=httpClientPoolImpl",
description = "HTTP Client Pool")
public class HttpClientPoolImpl implements HttpClientPool {
....
@ManagedMetric(category = "utilization", displayName = "Number of clients available",
description = "The number of HTTP clients available in the pool",
metricType = MetricType.GAUGE, unit = "none")
public synchronized int getNumberOfClientsAvailable() {
return clientsAvailable;
}
[/code]
The following extract from the Hyperic agent's logfile shows that the autodiscoverer is throwing a NullPointerException:
[code]
2010-06-08 15:59:28,304 INFO [Thread-2] [RuntimeAutodiscoverer] Running runtime autodiscovery for SpringSource tc Runtime 6.0
2010-06-08 15:59:28,344 ERROR [Thread-2] [RuntimeAutodiscoverer] Unexpected error running autodiscoverer for plugin: SpringSource
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at org.hyperic.hq.product.PluginUpdater.addProperties(PluginUpdater.java:77)
at org.hyperic.hq.product.PluginUpdater.updatePluginData(PluginUpdater.java:84)
at org.hyperic.hq.product.PluginUpdater.updateServiceTypes(PluginUpdater.java:110)
at org.hyperic.hq.product.ServerDetector.discoverResources(ServerDetector.java:218)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan_internal(RuntimeAutodiscoverer.java:272)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan(RuntimeAutodiscoverer.java:205)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:165)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
[/code]
I'd appreciate any help I can get. The logfile indicates a bug in the Hyperic agent, but is this the reason for not discovering the MBeans?
Thanks
Rob