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]$
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.
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.
(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
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