Bug 784903 - JON 3.0.1 RC#1: executing CLI doc example 7.2.6 gives error
JON 3.0.1 RC#1: executing CLI doc example 7.2.6 gives error
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Documentation (Show other bugs)
3.0.1
Unspecified Unspecified
high Severity high (vote)
: ---
: JON 3.0.1
Assigned To: Deon Ballard
Mike Foley
:
Depends On:
Blocks: jon310-sprint11/rhq44-sprint11
  Show dependency treegraph
 
Reported: 2012-01-26 10:42 EST by Mike Foley
Modified: 2012-06-21 19:14 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-21 19:14:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
CLI Doc example 7.2.6 (440 bytes, text/javascript)
2012-01-26 10:42 EST, Mike Foley
no flags Details

  None (edit)
Description Mike Foley 2012-01-26 10:42:15 EST
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 11:26:12 EST
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos
Comment 2 Jay Shaughnessy 2012-01-31 17:22:54 EST
looks like it needs a decl for the 'agents' variable:

+  var agents = new Array();
   var idx=0;
Comment 3 Ian Springer 2012-02-01 11:28:23 EST
Reassigning to Deon so she can add the missing line to the script in the docs.
Comment 5 Deon Ballard 2012-06-21 19:14:44 EDT
Closing.

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