I can confirm this isn't reproducible with Oracle JDK.
I've created a bug:
https://issues.apache.org/bugzilla/show_bug.cgi?id=57567

Shmuel Krakower.
www.Beatsoo.org - re-use your jmeter scripts for application performance
monitoring from worldwide locations for free.

On Wed, Feb 11, 2015 at 11:39 AM, Shmuel Krakower <[email protected]>
wrote:

> Hi,
>
> I'm having a strange issue with the following JSR223 pre-processor,
> javascript code:
> var now = new Date().toISOString();
>
> On my laptop using Oracle JRE 7 it works fine.
> On my server, using OpenJDK 7 I get the following error, which claims that
> there is no toISOString function to the date object:
>
> 2015/02/11 09:16:39 ERROR - jmeter.modifiers.JSR223PreProcessor: Problem
> in JSR223 script  javax.script.ScriptException:
> sun.org.mozilla.javascript.EcmaError: TypeError: Cannot find function
> toISOString in object Wed Feb 11 2015 09:16:39 GMT-0000 (UTC). (<Unknown
> source>#3) in <Unknown source> at line number 3
>         at
> com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:224)
>         at
> com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:240)
>         at
> javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
>         at
> org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:202)
>         at
> org.apache.jmeter.modifiers.JSR223PreProcessor.process(JSR223PreProcessor.java:42)
>         at
> org.apache.jmeter.threads.JMeterThread.runPreProcessors(JMeterThread.java:749)
>         at
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:414)
>         at
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: sun.org.mozilla.javascript.EcmaError: TypeError: Cannot find
> function toISOString in object Wed Feb 11 2015 09:16:39 GMT-0000 (UTC).
> (<Unknown source>#3)
>         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.typeError(ScriptRuntime.java:3660)
>         at
> sun.org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)
>         at
> sun.org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3743)
>         at
> sun.org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2247)
>         at
> sun.org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214)
>         at
> sun.org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3143)
>         at
> sun.org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
>         at
> sun.org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
>         at
> sun.org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
>         at
> com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:116)
>         at
> com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:109)
>         at
> sun.org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
>         at
> sun.org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
>         at
> sun.org.mozilla.javascript.Context.evaluateReader(Context.java:1135)
>         at
> com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:214)
>         ... 8 more
>
> Any idea what do I miss here?
> I'll try getting Oracle JDK on the server in the meanwhile and will update
> if that resolve the issue...
>
> Shmuel Krakower.
> www.Beatsoo.org - re-use your jmeter scripts for application performance
> monitoring from worldwide locations for free.
>

Reply via email to