Bug 784361 - ResourceManager NullPointerException using autoImport.js
ResourceManager NullPointerException using autoImport.js
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
3.0.0
Unspecified Unspecified
urgent Severity high (vote)
: ---
: JON 3.0.1
Assigned To: Larry O'Leary
Mike Foley
:
: 781867 784628 (view as bug list)
Depends On: 766574
Blocks: jon310-sprint11/rhq44-sprint11 785899 786577 806590 808636 910832
  Show dependency treegraph
 
Reported: 2012-01-24 12:25 EST by Charles Crouch
Modified: 2015-02-01 18:27 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 766574
Environment:
Last Closed: 2013-03-14 11:06:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Comment 1 Charles Crouch 2012-01-24 12:26:26 EST
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 12:32:01 EST
*** Bug 781867 has been marked as a duplicate of this bug. ***
Comment 3 Larry O'Leary 2012-01-30 15:01:09 EST
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 17:22:10 EST
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 11:22:41 EST
*** Bug 784628 has been marked as a duplicate of this bug. ***
Comment 6 Mike Foley 2012-02-02 14:11:55 EST
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 14:13:55 EST
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]$

Note You need to log in before you can comment on or make changes to this bug.