Bug 1303935 - DataSourceComponent assumes object can be cast to String always
DataSourceComponent assumes object can be cast to String always
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 7 (Show other bugs)
JON 3.3.5
Unspecified Unspecified
high Severity medium
: DR01
: One-off release
Assigned To: Simeon Pinder
Vojta Prusa
: Triaged
Depends On:
Blocks: 1314853
  Show dependency treegraph
 
Reported: 2016-02-02 07:57 EST by Michael Burman
Modified: 2016-06-06 14:56 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-06 14:56:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Burman 2016-02-02 07:57:08 EST
Description of problem: DataSourceComponent assumes that object read from the DMR is always castable to String (and then parsed to Double for Measurement collecting).

This is not the case with EAP7, which returns an Integer and causes ClassCastException.


Version-Release number of selected component (if applicable): RHQ master / JON 3.3.5


How reproducible: Always with EAP7


Steps to Reproduce:
1. Start EAP7
2. Add to JON
3. Wait for ExampleDS measurements to be collected

Actual results: Collection data fails with ClassCastException:

2016-02-02 14:52:58,330 WARN  [MeasurementManager.collector-1] (rhq.core.pc.measurement.MeasurementCollectorRunner)- Failure to collect measurement data for Resource[id=10488, uuid=7821ca50-e30c-4e3f-a7ee-2074cdb2fbcb, type={JBossAS7}DataSource (Standalone), key=subsystem=datasources,data-source=ExampleDS, name=ExampleDS, parent=datasources] - cause: java.lang.ClassCastException:java.lang.Integer cannot be cast to java.lang.String


Expected results: Measurements are correctly collected and stored in double.


Additional info:
Comment 1 Michael Burman 2016-02-02 08:45:38 EST
Fixed in the master:

commit 3d44f1960b9282a142285b038a476adfa62d9e22
Author: Michael Burman <miburman@redhat.com>
Date:   Tue Feb 2 15:44:47 2016 +0200

    [BZ 1303935] Do not assume DMR object can be cast to String
Comment 2 Simeon Pinder 2016-02-19 10:34:35 EST
Available for test in the following build:
http://jon01.mw.lab.eng.bos.redhat.com:8042/dist/release/jon/plugins/eap/3.3/Update-03/DR01/
Comment 3 Vojta Prusa 2016-02-24 09:33:48 EST
Result after update of eap plugin (for JON 3.3.5 with agent on EAP7):

2016-02-24 09:29:57,725 INFO  [MeasurementManager.collector-1] (rhq.core.pc.measurement.MeasurementCollectorRunner)- [PERF] Collection of measurements for [Resource[id=11121, uuid=17845b7a-2ca3-49d6-bc0b-89e391be500d, type={JBossAS7}DataSource (Standalone), key=subsystem=datasources,data-source=ExampleDS, name=ExampleDS, parent=datasources]] (component=[org.rhq.modules.plugins.jbossas7.DatasourceComponent@7cbe9148]) took [17847]ms
Comment 4 Vojta Prusa 2016-02-24 09:41:19 EST
For Update-03 DR01

(In reply to Vojta Prusa from comment #3)
> Result after update of eap plugin (for JON 3.3.5 with agent on EAP7):
> 
> 2016-02-24 09:29:57,725 INFO  [MeasurementManager.collector-1]
> (rhq.core.pc.measurement.MeasurementCollectorRunner)- [PERF] Collection of
> measurements for [Resource[id=11121,
> uuid=17845b7a-2ca3-49d6-bc0b-89e391be500d, type={JBossAS7}DataSource
> (Standalone), key=subsystem=datasources,data-source=ExampleDS,
> name=ExampleDS, parent=datasources]]
> (component=[org.rhq.modules.plugins.jbossas7.DatasourceComponent@7cbe9148])
> took [17847]ms
Comment 5 Michael Burman 2016-03-03 10:58:41 EST
Replaces previous commit in the master:

commit b57684bf616bad1444735ceced9f764b99318d72
Author: Michael Burman <miburman@redhat.com>
Date:   Thu Mar 3 17:21:56 2016 +0200

    [BZ 1314385] Initial implementation of wfly-10 plugin (copy of jboss-as-7 plugin)
Comment 7 Vojta Prusa 2016-03-10 06:29:27 EST
EAP plugin Update-03 DR02 does not support EAP7...

Verified for EAP6:

2016-03-10 06:28:28,526 INFO  [MeasurementManager.collector-1] (rhq.core.pc.measurement.MeasurementCollectorRunner)- [PERF] Collection of measurements for [Resource[id=12148, uuid=a42e2827-cefc-4ff4-b719-01613c1f9e41, type={JBossAS7}DataSource (Standalone), key=subsystem=datasources,data-source=ExampleDS, name=ExampleDS, parent=datasources]] (component=[org.rhq.modules.plugins.jbossas7.DatasourceComponent@2406e1ed]) took [2744]ms
Comment 9 Vojta Prusa 2016-03-24 08:33:13 EDT
No warnings in rhq-agent/logs/agent.log
ExampleDS resource up and measurements updated - checked in GUI.
Info message as for EAP6 (JBossAS7) did not occurred..

Note You need to log in before you can comment on or make changes to this bug.