JBoss EAP management plug-in fails to collect datasource metrics when min or max pool size value includes a system property or expression
Issue
- (rhq.core.pc.measurement.MeasurementCollectorRunner)- Failure to collect measure
-
I got WARN in the agent.log as follow:
WARN [MeasurementManager.collector-1] (rhq.core.pc.measurement.MeasurementCollectorRunner)- Failure to collect measurement data for Resource[id=19035, uuid=7b70ba45-f941-144d-02dc-ab9f5afeeab2, type={JBossAS7}DataSource (Standalone), key=subsystem=datasources,data-source=MyAppDS, name=MyAppDS, parent=datasources] - cause: java.lang.ClassCastException:java.util.LinkedHashMap cannot be cast to java.lang.Integer -
The following errors or warnings are being logged by the agent:
ERROR [WorkerThread#0[127.0.0.1:36143]] (rhq.core.pc.measurement.MeasurementManager)- Could not get measurement values java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.Integer at org.rhq.modules.plugins.jbossas7.DatasourceComponent.getRCAsMetric(DatasourceComponent.java:395) at org.rhq.modules.plugins.jbossas7.DatasourceComponent.getValues(DatasourceComponent.java:206) ... WARN [MeasurementManager.collector-1] (rhq.core.pc.measurement.MeasurementCollectorRunner)- Failure to collect measurement data for Resource[id=10153, uuid=2c96de45-00f1-4310-91ac-1b9d7806254b, type={JBossAS7}DataSource (Standalone), key=subsystem=datasources,data-source=NoTxRHQDS, name=NoTxRHQDS, parent=datasources], requests=[ScheduledMeasurementInfo[res=10153, name=min-pool-size, sched=11799], ScheduledMeasurementInfo[res=10153, name=max-pool-size, sched=11800]], report.size()=3 java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.Integer at org.rhq.modules.plugins.jbossas7.DatasourceComponent.getRCAsMetric(DatasourceComponent.java:395) at org.rhq.modules.plugins.jbossas7.DatasourceComponent.getValues(DatasourceComponent.java:208) at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocation.call(ResourceContainer.java:654) ... -
Metric collection fails with
java.lang.ClassCastException:java.util.LinkedHashMap cannot be cast to java.lang.Integer
Environment
- Red Hat JBoss Operations Network (ON) 3.2.0
- Red Hat JBoss Enterprise Application Platform (EAP) 6 management plug-in for JBoss ON
- JBoss EAP datasource deployed
-
Datasource's pool configuration includes
min-pool-sizeormax-pool-sizeelement which uses a system property in its value:... <pool> <min-pool-size>${my.app.ds.minpool:5}</min-pool-size> <max-pool-size>${my.app.ds.maxpool:100}</max-pool-size> </pool> ...
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
