NullPointerException is always thrown when running the two scripts in multiple threads with the same GroovyScriptEngine instance.
Besides the NPE,the result is not correct sometime.
Here is a wrong result:
java.lang.NullPointerException
at groovy.util.GroovyScriptEngine$ScriptCacheEntry.access$502(GroovyScriptEngine.java:101)
at groovy.util.GroovyScriptEngine.updateCacheEntry(GroovyScriptEngine.java:358)
at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:395)
at GroovyConcurrentTest$ScriptRunner.run(GroovyConcurrentTest.java:63)
run :script2.groovy result:script2
run :script3.groovy result:null
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
I extpect the resut looks like this:
run :script2.groovy result:script2
run :script3.groovy result:script3
Maybe the NPE is caused by the currentCacheEntry is null?
Thanks.