Bug 784361

Summary: ResourceManager NullPointerException using autoImport.js
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: CLIAssignee: Larry O'Leary <loleary>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: urgent    
Version: 3.0.0CC: bkramer, hbrock, hrupp, loleary, mazz, mfoley, nsaad
Target Milestone: ---   
Target Release: JON 3.0.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 766574 Environment:
Last Closed: 2013-03-14 15:06:32 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: 766574    
Bug Blocks: 782579, 785899, 786577, 806590, 808636, 910832    

Comment 1 Charles Crouch 2012-01-24 17:26:26 UTC
This fix needs to be backported to the jon3.0.1 branch of the RHQ repo, checked by engineering, then set to ON-QA

Comment 2 Charles Crouch 2012-01-24 17:32:01 UTC
*** Bug 781867 has been marked as a duplicate of this bug. ***

Comment 3 Larry O'Leary 2012-01-30 20:01:09 UTC
There are two issues included in this bug. For testing:

#. Install JON server/agent and register agent with JON but DO NOT import platform, agent, etc into inventory
#. Start JON system as normal
#. Using CLI:
   ./rhq-cli.sh -u rhqadmin -p rhqadmin -s localhost -t 7080 
   var criteria = ResourceCriteria();
   criteria.addFilterInventoryStatus(InventoryStatus.NEW);
   ResourceManager.findResourcesByCriteria(criteria);

Actual Result:
   java.lang.NullPointerException

Expected Result:
   No NPE and a table of the resources that have not yet been imported into inventory (platform, agent, etc)


#. Save attachment 545664 [details] for use with the CLI
#. Using CLI:
   ./rhq-cli.sh -u rhqadmin -p rhqadmin -s localhost -t 7080 -f "<path to attachment 545664 [details]>"

Actual Result:
   javax.naming.NameNotFoundException: remote not bound

Expected Result:
   No error and NEW (uncommitted) resources get imported into JON inventory

Comment 4 Larry O'Leary 2012-01-30 22:22:10 UTC
First issue (NPE) committed to release/jon3.0.x branch as
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=99ff4f9c796c171b74c3e09b404a2c397607a698

Second issue (remote not bound) committed to release/jon3.0.x branch as
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=a4602636483a6c8a3093dd16e16c97498286bba9

Comment 5 Ian Springer 2012-02-01 16:22:41 UTC
*** Bug 784628 has been marked as a duplicate of this bug. ***

Comment 6 Mike Foley 2012-02-02 19:11:55 UTC
Testcase #1

rhqadmin@localhost:7080$  var criteria = ResourceCriteria();                    

rhqadmin@localhost:7080$ criteria.addFilterInventoryStatus(InventoryStatus.NEW);

rhqadmin@localhost:7080$ ResourceManager.findResourcesByCriteria(criteria);     
one row
Resource:
	                 id: 10101
	               name: RHQ Agent
	            version: 4.2.0.JON.3.0.1.GA
	currentAvailability: ?
	       resourceType: RHQ Agent

rhqadmin@localhost:7080$

Comment 7 Mike Foley 2012-02-02 19:13:55 UTC
testcase #2

[mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -f /home/mfoley/CLI/JON301/rhq-remoting-cli-4.2.0.JON.3.0.1.GA/bin/autoImport.js 
Remote server version is: 3.0.1.GA (b2cb23b:859b914)
Login successful
Remote server version is: 3.0.1.GA (b2cb23b:859b914)
Running autoImport.js
Found resources to import: 
  RHQ Agent
[mfoley@foleymonsterbox1 bin]$