[
https://issues.apache.org/jira/browse/GROOVY-9493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17072568#comment-17072568
]
Paul King commented on GROOVY-9493:
-----------------------------------
For your info, the NPE indicates that the delegate GroovyClassLoader, normally
set in the InnerLoader constructor is null. My guess would be the Kotlin code
creating the InnerLoader isn't catering for such a possibility. Whether there
is an earlier interaction with Groovy, I can't be sure until I look at the code
or do some more debugging.
> JSR 223 regression: not working under OpenJ9 since version 3.0.0
> ----------------------------------------------------------------
>
> Key: GROOVY-9493
> URL: https://issues.apache.org/jira/browse/GROOVY-9493
> Project: Groovy
> Issue Type: Bug
> Components: groovy-jsr223
> Affects Versions: 3.0.0, 3.0.1, 3.0.2
> Reporter: Danilo Pianini
> Priority: Major
>
> Since version 3.0.0, Groovy fails at running JSR 223 scripts under OpenJ9.
> The issue does not appear under OpenJDK.
>
> The following is the result of the attempted evaluation of the script `1`
> under OpenJ9 12. The failure is reproducible with OpenJ9 11 and OpenJ9 14.
> Inside `GroovyScriptEngineImpl`, parameter `script` has value `"1"` (meaning
> a string of length 1 with the sole number 1 as content).
>
> ```
> java.lang.NullPointerExceptionjava.lang.NullPointerException at
> groovy.lang.GroovyClassLoader$InnerLoader.setDefaultAssertionStatus(GroovyClassLoader.java:617)
> at
> java.base/java.lang.ClassLoader.initializeClassLoaderAssertStatus(ClassLoader.java:1990)
> at java.base/java.lang.ClassLoader.<init>(ClassLoader.java:344) at
> java.base/java.lang.ClassLoader.<init>(ClassLoader.java:284) at
> java.base/java.security.SecureClassLoader.<init>(SecureClassLoader.java:77)
> at java.base/java.net.URLClassLoader.<init>(URLClassLoader.java:232) at
> groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:158) at
> groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:147) at
> groovy.lang.GroovyClassLoader$InnerLoader.<init>(GroovyClassLoader.java:472)
> at
> groovy.lang.GroovyClassLoader.lambda$createCollector$4(GroovyClassLoader.java:671)
> at groovy.lang.GroovyClassLoader$$Lambda$397.00000000283EE5D0.run(Unknown
> Source) at
> java.base/java.security.AccessController.doPrivileged(AccessController.java:678)
> at groovy.lang.GroovyClassLoader.createCollector(GroovyClassLoader.java:671)
> at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:385) at
> groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332)
> at groovy.lang.GroovyClassLoader$$Lambda$345.00000000284B4BF0.provide(Unknown
> Source) at
> org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
> at
> org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
> at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) at
> groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:314) at
> groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:257) at
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:336)
> at
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:153)
> at
> java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
> at
> it.unibo.alchemist.loader.variables.JSR223Variable.getWith(JSR223Variable.kt:39)
> at it.unibo.alchemist.loader.YamlLoader.<init>(YamlLoader.java:287) at
> it.unibo.alchemist.loader.YamlLoader.<init>(YamlLoader.java:220) at
> it.unibo.alchemist.SimulationLauncher.launch(SimulationLauncher.kt:42) at
> it.unibo.alchemist.Launcher$DefaultImpls.invoke(Launcher.kt:20) at
> it.unibo.alchemist.SimulationLauncher.invoke(SimulationLauncher.kt:27) at
> it.unibo.alchemist.Alchemist.main(Alchemist.kt:115) at
> TestCLIKt$runWithOptions$exit$1.invoke(TestCLI.kt:48) at
> TestCLIKt$runWithOptions$exit$1.invoke(TestCLI.kt) at
> TestCLIKt.runCatchingExit(TestCLI.kt:38) at
> TestCLIKt.runWithOptions(TestCLI.kt:47) at
> TestCLI$1$2.invokeSuspend(TestCLI.kt:69) at TestCLI$1$2.invoke(TestCLI.kt) at
> io.kotlintest.runner.jvm.TestCaseExecutor$executeTest$supervisorJob$1$invokeSuspend$$inlined$map$lambda$1.invokeSuspend(TestCaseExecutor.kt:121)
> at
> kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
> at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:831)
> ```
--
This message was sent by Atlassian Jira
(v8.3.4#803005)