Bug 604291
Summary: | NPE thrown by TabularWriter when querying resources from CLI | ||
---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | John Sanda <jsanda> |
Component: | CLI | Assignee: | John Sanda <jsanda> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Sudhir D <sdharane> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 3.0.0 | ||
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:49: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: | 593121 |
Description
John Sanda
2010-06-15 19:22:53 UTC
There is a copy/paste error in the description. The CLI commands for reproducing the NPE are, $ login rhqadmin rhqadmin $ criteria = ResourceCriteria(); // no need to specifiy new operator $ criteria.addFilterInventoryStatus(InventoryStatus.NEW); $ resources = ResourceManager.findResourcesByCriteria(criteria); But not all queries generate the exception. For instance, the following commands do not result in a NPE, $ login rhqadmin rhqadmin $ criteria = ResourceCriteria(); // no need to specifiy new operator $ resources = ResourceManager.findResourcesByCriteria(criteria); If this is a regression of 2.3.1 it needs to be Urgent priority I did not produce this exception with JON 2.3.1, so this must be a regression. Added null checks to avoid NPEs as well as added several unit tests; however, I think there is still a good bit of refactoring needed in this code. I will open a separate bug for that. commit hash: e98a76091f74b19d89c6b5bac2ded52320a08df9 I tried this on jon-server-2.4.0.GA_QA build# 42, which was out just an hour back, and I'm still hitting NPE. rhqadmin.redhat.com:7080$ criteria = ResourceCriteria(); ResourceCriteria: inventoryManagerRequired: false persistentClass: class org.rhq.core.domain.resource.Resource rhqadmin.redhat.com:7080$ criteria.addFilterInventoryStatus(InventoryStatus.NEW); rhqadmin.redhat.com:7080$ resources = ResourceManager.findResourcesByCriteria(criteria); java.lang.NullPointerException at org.rhq.enterprise.client.TabularWriter.shortVersion(TabularWriter.java:674) at org.rhq.enterprise.client.TabularWriter.print(TabularWriter.java:337) at org.rhq.enterprise.client.TabularWriter.print(TabularWriter.java:123) at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:177) at org.rhq.enterprise.client.ClientMain.executePromptCommand(ClientMain.java:303) at org.rhq.enterprise.client.ClientMain$1.run(ClientMain.java:248) at java.lang.Thread.run(Thread.java:636) I shall try it again on another latest build. So still keeping this with ON_QA. Verified this against jon-server-2.4.0.GA_QA build# 44 rhqadmin.redhat.com:7080$ criteria = ResourceCriteria(); ResourceCriteria: inventoryManagerRequired: false persistentClass: class org.rhq.core.domain.resource.Resource rhqadmin.redhat.com:7080$ criteria.addFilterInventoryStatus(InventoryStatus.NEW); rhqadmin.redhat.com:7080$ resources = ResourceManager.findResourcesByCriteria(criteria); no data rhqadmin.redhat.com:7080$ I don't see NPE. Marking this bug as verified. Mass-closure of verified bugs against JON. |