Bug 1303935 - DataSourceComponent assumes object can be cast to String always
Summary: DataSourceComponent assumes object can be cast to String always
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 7
Version: JON 3.3.5
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: DR01
: One-off release
Assignee: Simeon Pinder
QA Contact: Vojta Prusa
URL:
Whiteboard:
Depends On:
Blocks: 1314853
TreeView+ depends on / blocked
 
Reported: 2016-02-02 12:57 UTC by Michael Burman
Modified: 2016-06-06 18:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-06 18:56:59 UTC
Type: Bug


Attachments (Terms of Use)

Description Michael Burman 2016-02-02 12:57:08 UTC
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 13:45:38 UTC
Fixed in the master:

commit 3d44f1960b9282a142285b038a476adfa62d9e22
Author: Michael Burman <miburman>
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 15:34:35 UTC
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 14:33:48 UTC
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 14:41:19 UTC
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 15:58:41 UTC
Replaces previous commit in the master:

commit b57684bf616bad1444735ceced9f764b99318d72
Author: Michael Burman <miburman>
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 11:29:27 UTC
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 12:33:13 UTC
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.