Unanswered question

Unable to run Javascript in Neoload 6.6?

I've used javascript in Neoload before to write things to the log but am finding with 6.6 it causes execution to crash.
It'll execute a couple of times fine and then there's a stack dump in the log.
There's a stack dump in the log:
The first couple of lines are the correct output then the dump!
2018/11/13 16:12:27 DEBUG - neoload.JavaScript.writeLog: Invoice quni00002with 00002 lines has status Submitted
2018/11/13 16:12:30 DEBUG - neoload.JavaScript.writeLog: Invoice quni00004with 00004 lines has status Submitted
2018/11/13 16:12:34 FATAL - neoload.Misc: Error while calling evaluateScript method java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.neotys.nl.js.f.a(f.java:50)
at com.neotys.nl.lg.engine.Q.internalExecute(Q.java:61)
at com.neotys.nl.lg.engine.l.a(l.java:146)
at com.neotys.nl.lg.engine.v.c(v.java:125)
at com.neotys.nl.lg.engine.w.internalExecute(w.java:83)
at com.neotys.nl.lg.engine.l.a(l.java:146)
at com.neotys.nl.lg.engine.H.i(H.java:251)
at com.neotys.nl.lg.engine.H.internalExecute(H.java:98)
at com.neotys.nl.lg.engine.l.a(l.java:146)
at com.neotys.nl.lg.engine.c.a(c.java:177)
at com.neotys.nl.lg.engine.c.run(c.java:108)
Caused by: java.lang.IllegalAccessError: class sun.reflect.GeneratedMethodAccessor9 cannot access its superclass sun.reflect.MethodAccessorImpl
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
at sun.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:53)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.neotys.nl.js.c.a(c.java:38)
at com.neotys.nl.js.c.g(c.java:102)
at com.neotys.nl.js.api.i.e(i.java:90)
at com.neotys.nl.js.api.VariableManager.jsFunction_getValue(VariableManager.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:476)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
at org.mozilla.javascript.gen.writeLog_1._c_script_0(writeLog:11)
at org.mozilla.javascript.gen.writeLog_1.call(writeLog)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
at org.mozilla.javascript.gen.writeLog_1.call(writeLog)
at org.mozilla.javascript.gen.writeLog_1.exec(writeLog)
at com.neotys.nl.js.api.d.evaluateScript(d.java:351)
... 15 more

Clive W.
Clive W.

Clive W.

Level
0
34 / 100
points

Answers

Fousseyni B.
Fousseyni B.

Fousseyni B.

Level
1
351 / 750
points

Hello Clive,

Are there a lot data like a big size file variable involved in your javascript action ?

Best Regards,

Clive W.
Clive W.

Clive W.

Level
0
34 / 100
points

There is a 20 MB file used as a parameter file. This doesn't cause any problems without using the javascript.
There's loads of memory available on the agent boxes - they've 230 GB assigned.
The java script that fails is very basic - used very similar before with Neoload no problems.

var lineCounter = context.variableManager.getValue("lineCounter");
if ( lineCounter==null) {
context.fail("Variable ' lineCounter' not found");
}
var invoiceNumber = context.variableManager.getValue("invoiceNumber");
if ( invoiceNumber==null) {
context.fail("Variable 'invoiceNumber' not found");
}
var invoiceStatus = context.variableManager.getValue("invoiceStatus");
if ( invoiceStatus==null) {
context.fail("Variable 'invoiceStatus' not found");
}
// Do some computation using the methods
// you defined in the JS Library

logger.debug("Invoice " + invoiceNumber + " with "+ lineCounter + " lines has status " + invoiceStatus);