You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Ryan Miller (Jira)" <ji...@apache.org> on 2023/06/16 07:17:00 UTC

[jira] [Updated] (NIFI-11700) Java 17 Nashorn standalone support

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

Ryan Miller updated NIFI-11700:
-------------------------------
    Description: 
h2. Motivation

Nashorn was removed with the release of JDK 15 and is unavailable in Java 17. Standalone Nashorn or a scripting engine alternative is required for scripting processors to run ECMAScript.
h2. Related Tickets

Requires:

 - Support building with version 61 class files [1]

Past Related Tickets:
 - Support building with Java 17 [2]

h2. Versions
 - openjdk 17.0.7 2023-04-18

 - NiFi 2.0.0-SNAPSHOT (fork) [3]

 - Maven 3.9.2 (mvn) [4]

h2. Setup
 * Clone NiFi repo v2.0.0
 * Add Nashorn standalone (see fork) [3]

 
{code:java}
<dependency>
            <groupId>org.openjdk.nashorn</groupId>
            <artifactId>nashorn-core</artifactId>
            <version>15.4</version>
            <scope>provided</scope>
</dependency>
{code}
 * Add Nashorn to the script engine (see fork) [3]

 * Build NiFi
 * Run NiFi

 

NiFi crashed after startup, nifi-app.log contains the relevant errors.

Adding standalone Nashorn to NiFi caused the following errors to occur:

 
{code:java}
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:177)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:163)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:284)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:932)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:917)
    at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$2(AnnotationParser.java:876)
    ... 9 common frames omitted
 
Caused by: java.lang.RuntimeException: Error scanning entry com/fasterxml/jackson/core/io/doubleparser/FastDoubleSwar.class from jar file:///<path>/<to>/<nifi>/nifi-assembly/target/nifi-2.0.0-SNAPSHOT-bin/nifi-2.0.0-SNAPSHOT/work/jetty/nifi-standard-content-viewer-2.0.0-SNAPSHOT.war/webapp/WEB-INF/lib/jackson-core-2.15.2.jar
    at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$2(AnnotationParser.java:880)
    at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:3215)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotgradleationParser.java:872)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:835)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:455)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
    at java.base/java.lang.Thread.run(Thread.java:833)
 
{code}
 

These errors were caused by NiFi not supporting the building of version 61 class files (class files in packages built with Java 17).

 

[1] https://issues.apache.org/jira/browse/MCOMPILER-539

[2] https://issues.apache.org/jira/browse/NIFI-9281

[3] [https://github.com/Aerilym/nifi/tree/nashorn]

[4] [https://maven.apache.org/install.html]

  was:
h2. Motivation

Nashorn was removed with the release of JDK 15 and is unavailable in Java 17. Standalone Nashorn or a scripting engine alternative is required for scripting processors to run ECMAScript.
h2. Related Tickets

Requires:

 - Support building with version 61 class files [1]

Past Related Tickets:
- Support building with Java 17 [2]
h2. Versions

- openjdk 17.0.7 2023-04-18

- NiFi 2.0.0-SNAPSHOT (fork) [3]

- Maven 3.9.2 (mvn) [4]

 
h2. Setup
 * Clone NiFi repo v2.0.0
 * Add Nashorn standalone (see fork) [3]

 
{code:java}
<dependency>
            <groupId>org.openjdk.nashorn</groupId>
            <artifactId>nashorn-core</artifactId>
            <version>15.4</version>
            <scope>provided</scope>
</dependency>
{code}
 * Add Nashorn to the script engine (see fork) [3]

 * Build NiFi
 * Run NiFi

 

NiFi crashed after startup, nifi-app.log contains the relevant errors.

Adding standalone Nashorn to NiFi caused the following errors to occur:

 

 
{code:java}
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:177)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:163)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:284)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:932)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:917)
    at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$2(AnnotationParser.java:876)
    ... 9 common frames omitted
 
Caused by: java.lang.RuntimeException: Error scanning entry com/fasterxml/jackson/core/io/doubleparser/FastDoubleSwar.class from jar file:///<path>/<to>/<nifi>/nifi-assembly/target/nifi-2.0.0-SNAPSHOT-bin/nifi-2.0.0-SNAPSHOT/work/jetty/nifi-standard-content-viewer-2.0.0-SNAPSHOT.war/webapp/WEB-INF/lib/jackson-core-2.15.2.jar
    at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$2(AnnotationParser.java:880)
    at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:3215)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotgradleationParser.java:872)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:835)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:455)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
    at java.base/java.lang.Thread.run(Thread.java:833)
 
{code}
 

These errors were caused by NiFi not supporting the building of version 61 class files (class files in packages built with Java 17).

 

[1] TBA: Support building with version 61 class files

[2] https://issues.apache.org/jira/browse/NIFI-9281

[3] [https://github.com/Aerilym/nifi/tree/nashorn]

[4] [https://maven.apache.org/install.html]


> Java 17 Nashorn standalone support
> ----------------------------------
>
>                 Key: NIFI-11700
>                 URL: https://issues.apache.org/jira/browse/NIFI-11700
>             Project: Apache NiFi
>          Issue Type: Wish
>            Reporter: Ryan Miller
>            Priority: Minor
>
> h2. Motivation
> Nashorn was removed with the release of JDK 15 and is unavailable in Java 17. Standalone Nashorn or a scripting engine alternative is required for scripting processors to run ECMAScript.
> h2. Related Tickets
> Requires:
>  - Support building with version 61 class files [1]
> Past Related Tickets:
>  - Support building with Java 17 [2]
> h2. Versions
>  - openjdk 17.0.7 2023-04-18
>  - NiFi 2.0.0-SNAPSHOT (fork) [3]
>  - Maven 3.9.2 (mvn) [4]
> h2. Setup
>  * Clone NiFi repo v2.0.0
>  * Add Nashorn standalone (see fork) [3]
>  
> {code:java}
> <dependency>
>             <groupId>org.openjdk.nashorn</groupId>
>             <artifactId>nashorn-core</artifactId>
>             <version>15.4</version>
>             <scope>provided</scope>
> </dependency>
> {code}
>  * Add Nashorn to the script engine (see fork) [3]
>  * Build NiFi
>  * Run NiFi
>  
> NiFi crashed after startup, nifi-app.log contains the relevant errors.
> Adding standalone Nashorn to NiFi caused the following errors to occur:
>  
> {code:java}
> Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
>     at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
>     at org.objectweb.asm.ClassReader.<init>(ClassReader.java:177)
>     at org.objectweb.asm.ClassReader.<init>(ClassReader.java:163)
>     at org.objectweb.asm.ClassReader.<init>(ClassReader.java:284)
>     at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:932)
>     at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:917)
>     at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$2(AnnotationParser.java:876)
>     ... 9 common frames omitted
>  
> Caused by: java.lang.RuntimeException: Error scanning entry com/fasterxml/jackson/core/io/doubleparser/FastDoubleSwar.class from jar file:///<path>/<to>/<nifi>/nifi-assembly/target/nifi-2.0.0-SNAPSHOT-bin/nifi-2.0.0-SNAPSHOT/work/jetty/nifi-standard-content-viewer-2.0.0-SNAPSHOT.war/webapp/WEB-INF/lib/jackson-core-2.15.2.jar
>     at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$2(AnnotationParser.java:880)
>     at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:3215)
>     at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
>     at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotgradleationParser.java:872)
>     at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:835)
>     at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
>     at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:455)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
>     at java.base/java.lang.Thread.run(Thread.java:833)
>  
> {code}
>  
> These errors were caused by NiFi not supporting the building of version 61 class files (class files in packages built with Java 17).
>  
> [1] https://issues.apache.org/jira/browse/MCOMPILER-539
> [2] https://issues.apache.org/jira/browse/NIFI-9281
> [3] [https://github.com/Aerilym/nifi/tree/nashorn]
> [4] [https://maven.apache.org/install.html]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)