Bug 586918
| Summary: | AlertDefinitionCriteria throws ClassCastException if filterAlertTemplateParentId / filterAlertTemplateResourceTypeId is set | ||
|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | Joseph Marques <jmarques> |
| Component: | CLI | Assignee: | Joseph Marques <jmarques> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Sudhir D <sdharane> |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 3.0.0 | CC: | smohan |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | 2.4 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-08-12 16:54:08 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 584435 | ||
|
Description
Joseph Marques
2010-04-28 14:05:02 UTC
commit 303467aeda8d90b48cb68581d53211c774a82fd5 fix for ClassCastException when using AlertDefinitionCriteria when filtering by either alertTemplateParentId or alertTemplateResourceTypeId I tried this out on Build# 166 Version: 2.4 SNAPSHOT.
I don't seem to get any output. I'm not seeing any error though.
Below is what I did.
1. Created a new alert template at platform level Linux.
2. Ran the below SQL query to identify the ID
template1=# select id,description from rhq_alert_definition;
id | description
-------+----------------------------------
10001 | Group alert for linux group type
10011 | Alert for an event
10021 | Platform event alert
10031 | linux alert template
10032 | linux alert template
10033 | linux alert template
(6 rows)
3. Installed the CLI and ran the below commands,
[root@dhcp6-150 bin]# ./rhq-cli.sh -u rhqadmin -P -s dhcp6-150.pnq.redhat.com -t 7080
password:
RHQ - RHQ Enterprise Remote CLI 3.0.0-SNAPSHOT
Remote server version is: 3.0.0-SNAPSHOT(53d34d5)
Login successful
rhqadmin.redhat.com:7080$ var c1 = new AlertDefinitionCriteria()
rhqadmin.redhat.com:7080$ c1.addFilterAlertTemplateParentId(10031)
rhqadmin.redhat.com:7080$
rhqadmin.redhat.com:7080$ var c1 = new AlertDefinitionCriteria()
rhqadmin.redhat.com:7080$ c1.addFilterAlertTemplateParentId(10032)
rhqadmin.redhat.com:7080$
rhqadmin.redhat.com:7080$ var c1 = new AlertDefinitionCriteria()
rhqadmin.redhat.com:7080$ c1.addFilterAlertTemplateParentId(10033)
rhqadmin.redhat.com:7080$
rhqadmin.redhat.com:7080$
I tried with all the other IDs too, but no output.
please re-read the reproduction steps. you missing the line where it said to execute "AlertDefinitionManager.findAlertDefinitionsByCriteria(c1)" Ah, my fault. I retried and below is the output. rhqadmin.redhat.com:7080$ var c1 = new AlertDefinitionCriteria() rhqadmin.redhat.com:7080$ c1.addFilterAlertTemplateParentId(10001) rhqadmin.redhat.com:7080$ AlertDefinitionManager.findAlertDefinitionsByCriteria(c1) one row AlertDefinition: alertDampening: org.rhq.core.domain.alert.AlertDampening[ category=NONE[] ] conditionExpression: ANY context: Resource controlFiltered: false ctime: 1275046299710 deleted: false description: Linux alert template enabled: true id: 10002 mtime: 1275046299710 name: Linux System Load Alert notifyFiltered: false parentId: 10001 priority: !! - Medium readOnly: false recoveryId: 0 resource: Resource[id=10001, type=Linux, key=dhcp6-150.pnq.redhat.com-embedded, name=dhcp6-150.pnq.redhat.com-embedded, parent=<null>, version=Linux 2.6.18-164.11.1.el5] willRecover: false Marking this bug as verified. Mass-closure of verified bugs against JON. |