Bug 722601

Summary: CLI: NPE in org.rhq.enterprise.client.TabularWriter.shortVersion()
Product: [Other] RHQ Project Reporter: Ondřej Žižka <ozizka>
Component: CLIAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 3.0.1CC: fdrabek, hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Ondřej Žižka 2011-07-15 15:46:32 EDT
Using empty criteria results in NPE.

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$
var criteria = new ResourceCriteria();

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ 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:662)
Comment 1 Ondřej Žižka 2011-07-15 15:46:52 EDT
JON 2.4.1
Comment 2 Ondřej Žižka 2011-07-15 15:54:09 EDT
rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ var x = ResourceManager.findResourcesByCriteria(criteria)

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ x
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:662)

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ " " + x
 PageList[Resource[id=10001, type=Linux, key=dev85.mw.lab.eng.bos.redhat.com, name=dev85.mw.lab.eng.bos.redhat.com, parent=<null>, version=Linux 2.6.32-131.2.1.el6.x86_64], Resource[id=10003, type=JBossAS Server, key=/mnt/hudson_workspace/workspace/JON24-EAP5-integration/eap/server/all, name=dev85.mw.lab.eng.bos.redhat.com:1099 all, parent=dev85.mw.lab.eng.bos.redhat.com, version=5.1.1], Resource[id=10002, type=RHQ Agent, key=RHQ Agent, name=RHQ Agent, parent=dev85.mw.lab.eng.bos.redhat.com, version=3.0.1.GA]