Bug 734895 - error running CLI samples
Summary: error running CLI samples
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 4.1
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: ---
Assignee: Deon Ballard
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon30-bugs rhq42
TreeView+ depends on / blocked
 
Reported: 2011-08-31 19:19 UTC by Mike Foley
Modified: 2013-08-31 10:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-31 10:50:38 UTC
Embargoed:


Attachments (Terms of Use)

Description Mike Foley 2011-08-31 19:19:50 UTC
Description of problem:  error running CLI samples


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


How reproducible:
100%

Steps to Reproduce:
1.  ./rhq-cli.sh -u rhqadmin -p rhqadmin -f /home/mfoley/rhq-remoting-cli-4.1.0-SNAPSHOT/rhq-remoting-cli-4.1.0-SNAPSHOT/bin/measurement_utils.js 

  
Actual results:
error (see below)

Expected results:
samples work without error

Additional info:
[mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -f /home/mfoley/rhq-remoting-cli-4.1.0-SNAPSHOT/rhq-remoting-cli-4.1.0-SNAPSHOT/bin/measurement_utils.js 
Remote server version is: 4.1.0-SNAPSHOT (5d4fbbe)
Login successful
Exception in thread "main" org.rhq.enterprise.client.script.CLIScriptException: javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "minutes" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
	at org.rhq.enterprise.client.commands.ScriptCommand.executeScriptFile(ScriptCommand.java:266)
	at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:90)
	at org.rhq.enterprise.client.ClientMain.processArguments(ClientMain.java:505)
	at org.rhq.enterprise.client.ClientMain.main(ClientMain.java:106)
Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "minutes" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
	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:255)
	... 3 more
Caused by: sun.org.mozilla.javascript.EcmaError: ReferenceError: "minutes" is not defined. (<Unknown source>#1)
	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.c469._c0(<Unknown source>:1)
	at sun.org.mozilla.javascript.gen.c469.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.c469.call(<Unknown source>)
	at sun.org.mozilla.javascript.gen.c469.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
[mfoley@foleymonsterbox1 bin]$

Comment 1 Heiko W. Rupp 2011-10-18 15:38:32 UTC
b95445e in master

Question is if actually a user is supposed to run them on their own - or if they are "libraries" that are supposed to be pulled in by other scripts.

Comment 2 Mike Foley 2011-10-18 15:58:52 UTC
That is a good question.  The samples should be more consumable by endusers ...and I think the issue here is the with the associated documenation.  changing to a doc issue.

Comment 3 Charles Crouch 2011-11-02 14:09:48 UTC
(8:54:07 AM) pilhuhn: ccrouch they do no longer "crash", but on their own not 
necessarily produce output. jsanda has encoded helpers in them that a user can 
copy or import for his own tools
(8:54:43 AM) pilhuhn: I've added links to (some of) his wiki articles hat 
explain the scripts more

Comment 4 Deon Ballard 2012-06-28 15:50:41 UTC
My underlying confusion was that I didn't understand (and I *think* this was Michael's issue, too) what the support scripts were supposed to do. 

I've added a small reference section to the CLI guide covering these support scripts:
http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/3.1/html/Dev_Writing_JON_Command-Line_Scripts/tips.html#utility-scripts


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