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:07:00 UTC

[jira] [Created] (NIFI-11701) Support building with version 61 class files

Ryan Miller created NIFI-11701:
----------------------------------

             Summary: Support building with version 61 class files
                 Key: NIFI-11701
                 URL: https://issues.apache.org/jira/browse/NIFI-11701
             Project: Apache NiFi
          Issue Type: Wish
            Reporter: Ryan Miller


h2. Motivation

Packages built using Java 17 create version 61 class files; these are currently unsupported in the Jetty and Maven Compiler Plugin versions used.
h2. Related Tickets

Requires:

- Upgrade Jetty to version 11 [1]

- Upgrade Maven Compiler Plugin to support version 61 class files [2]

Solves:

- Java 17 Nashorn standalone support [3]

 

In attempting to add Standalone Nashorn [4] (a package containing version 61 class files) to NiFi, the following error occurred:

 

Related Errors

 
{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
 
{code}
 

This error occurred because standalone Nashorn was bundled in JDK 17, and whatever is reading it and doing code transforms cannot read version 61 class files.

 
h2. Similar issue

 
{panel}
The problem (as pointed out by @Mark Rotteveel) is that glowroot is failing while trying to do some code transformation using ASM. Apparently the ClassReader in the version of ASM that is bundled in glowroot 0.13.6 doesn't understand version 61 (Java 17) class files.
{panel}
 

[5]

 

Fixing this issue will likely require updating one or more other NiFI dependencies. The error indicates Jetty is likely the issue as it does not support version 61 class files. Requiring upgrading Jetty to a version that supports version 61 class files [1].

 

Also, note that the Maven Compiler Plugin [6] needs to be upgraded to support version 61 class files too [2].

 

[1] TBA: Upgrade Jetty to version 11

[2] TBA: Upgrade Maven Compiler Plugin to support version 61 class files 

[3] https://issues.apache.org/jira/browse/NIFI-11700

[4] [https://mvnrepository.com/artifact/org.openjdk.nashorn/nashorn-core]

[5] [https://stackoverflow.com/questions/72227442/unsupported-class-file-major-version-61]

[6] [https://maven.apache.org/plugins/maven-compiler-plugin/]



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