Bug 784903

Summary: JON 3.0.1 RC#1: executing CLI doc example 7.2.6 gives error
Product: [Other] RHQ Project Reporter: Mike Foley <mfoley>
Component: DocumentationAssignee: Deon Ballard <dlackey>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: 3.0.1CC: hrupp, ian.springer, jshaughn
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: Environment:
Last Closed: 2012-06-21 23:14:44 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: 782579    
Attachments:
Description Flags
CLI Doc example 7.2.6 none

Description Mike Foley 2012-01-26 15:42:15 UTC
Created attachment 557694 [details]
CLI Doc example 7.2.6

Description of problem:   executing CLI doc example 7.2.6 gives error


Version-Release number of selected component (if applicable):  JON 3.01 RC1


How reproducible:100%



mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -f myCLIscript2.js 
Remote server version is: 3.0.1.GA (784c8ce:5cde182)
Login successful
Scanning all RHQ Agent instances
Exception in thread "main" org.rhq.enterprise.client.script.CLIScriptException: javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "agents" is not defined. (<Unknown source>#10) in <Unknown source> at line number 10
	at org.rhq.enterprise.client.commands.ScriptCommand.executeScriptFile(ScriptCommand.java:270)
	at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:101)
	at org.rhq.enterprise.client.ClientMain.processArguments(ClientMain.java:519)
	at org.rhq.enterprise.client.ClientMain.main(ClientMain.java:106)
Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "agents" is not defined. (<Unknown source>#10) in <Unknown source> at line number 10
	at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:133)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
	at org.rhq.enterprise.client.commands.ScriptCommand.executeScriptFile(ScriptCommand.java:259)
	... 3 more
Caused by: sun.org.mozilla.javascript.EcmaError: ReferenceError: "agents" is not defined. (<Unknown source>#10)
	at sun.org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
	at sun.org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
	at sun.org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717)
	at sun.org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1692)
	at sun.org.mozilla.javascript.gen.c299._c0(<Unknown source>:10)
	at sun.org.mozilla.javascript.gen.c299.call(<Unknown source>)
	at sun.org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
	at sun.org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
	at sun.org.mozilla.javascript.gen.c299.call(<Unknown source>)
	at sun.org.mozilla.javascript.gen.c299.exec(<Unknown source>)
	at sun.org.mozilla.javascript.Context.evaluateReader(Context.java:1135)
	at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:123)
	... 5 more

Comment 1 Mike Foley 2012-01-30 16:26:12 UTC
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos

Comment 2 Jay Shaughnessy 2012-01-31 22:22:54 UTC
looks like it needs a decl for the 'agents' variable:

+  var agents = new Array();
   var idx=0;

Comment 3 Ian Springer 2012-02-01 16:28:23 UTC
Reassigning to Deon so she can add the missing line to the script in the docs.

Comment 5 Deon Ballard 2012-06-21 23:14:44 UTC
Closing.