You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2019/05/20 18:27:00 UTC

[jira] [Assigned] (SLING-8425) NPE in SlingScriptEngineManager when Sling is run on GraalVM

     [ https://issues.apache.org/jira/browse/SLING-8425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Cotescu reassigned SLING-8425:
-----------------------------------

    Assignee: Radu Cotescu

> NPE in SlingScriptEngineManager when Sling is run on GraalVM
> ------------------------------------------------------------
>
>                 Key: SLING-8425
>                 URL: https://issues.apache.org/jira/browse/SLING-8425
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting Core 2.0.54
>         Environment: OS: Ubuntu 18.04.2 LTS
> JVM: OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode)
>            Reporter: Paul Bjorkstrand
>            Assignee: Radu Cotescu
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When trying to run Sling Starter 11 on GraalVM, there was an NPE in the SlingScriptEngineManager when it tried to call {{internalManager.registerEngineExtension}} inside {{registerAssociations}}. The problem is that a script engine provided by Graal (Nashorn, in this case) had {{null}} as an extension value.
> I imagine that it is a bug with GraalVM itself (I have not dug further into it yet), but Sling can be defensive, and not call the method(s) inside {{registerAssociations}} when it sees a null value for either an extension, mime type, or name.
> Fixing this issue also exposes another issue: the SlingScriptEngineManagerTest assumes that the JDK it is running on only has a single built-in scripting engine. In Graal, there could be two (or more) built-in scripting engines. In my situation, there were two: GraalJS and Nashorn. Even though Nashorn is a seemingly-broken engine in Graal, it still runs through the registration process, so the tests need to account for it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)