You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/04/01 00:02:00 UTC

[jira] [Comment Edited] (GROOVY-9493) JSR 223 regression: not working under OpenJ9 since version 3.0.0

    [ https://issues.apache.org/jira/browse/GROOVY-9493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17072239#comment-17072239 ] 

Paul King edited comment on GROOVY-9493 at 4/1/20, 12:01 AM:
-------------------------------------------------------------

I tried the following script:
{code}
import javax.script.*

var engine = new ScriptEngineManager().getEngineByName("groovy")
assert engine
var binding = new SimpleBindings(foo: 4, fiz: 0)
assert engine.eval("5 * foo", binding) == 20
var props = System.properties
println "$GroovySystem.version ${props['java.version']} ${props['java.vendor']}"
{code}
Trying with a few of Groovy/JVM versions, all succeed with these outputs:
{noformat}
3.0.2 10.0.2 Oracle Corporation
3.0.2 11.0.6 Eclipse OpenJ9
4.0.0-SNAPSHOT 11.0.6 AdoptOpenJDK
{noformat}


was (Author: paulk):
Just getting some easy to run cases first using hotspot. The following script (run from Groovy 3.0.2) succeeds:
{code}
import javax.script.*

var engine = new ScriptEngineManager().getEngineByName("groovy")
assert engine
var binding = new SimpleBindings(foo: 4, fiz: 0)
assert engine.eval("5 * foo", binding) == 20
{code}
I haven't tried running from Java yet.

> 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)