sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Radu Cotescu (JIRA)" <>
Subject [jira] [Resolved] (SLING-8425) NPE in SlingScriptEngineManager when Sling is run on GraalVM
Date Wed, 22 May 2019 09:26:00 GMT


Radu Cotescu resolved SLING-8425.
    Resolution: Fixed

> NPE in SlingScriptEngineManager when Sling is run on GraalVM
> ------------------------------------------------------------
>                 Key: SLING-8425
>                 URL:
>             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
>             Fix For: Scripting Core 2.0.58
>          Time Spent: 1.5h
>  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

View raw message