Skip to content

Automatically generate native-image conditional metadata for ChannelHandler implementations.#12794

Merged
chrisvest merged 2 commits into
netty:4.1from
gradinac:gradinac/fix-netty-4-handler-metadata
Sep 26, 2022
Merged

Automatically generate native-image conditional metadata for ChannelHandler implementations.#12794
chrisvest merged 2 commits into
netty:4.1from
gradinac:gradinac/fix-netty-4-handler-metadata

Conversation

@gradinac

Copy link
Copy Markdown
Contributor

Motivation:
Analogous to #12738, this PR introduces automatic conditional native-image metadata generation for different ChannelHandler implementations

Modification:
This PR is basically the same as #12738, but adapted to conform to the Java language level 6.
This PR also adds the metadata generation to more subprojects that contain ChannelHandler implementations.

Result:

Fixes #12725

@chrisvest

Copy link
Copy Markdown
Member

It ran into this failure in the Java 11 Graal build:

2022-09-11T02:23:41.2716286Z [INFO] --- native-image-maven-plugin:19.3.6:native-image (default) @ netty-testsuite-native-image-client ---
2022-09-11T02:23:41.2722293Z [INFO] ImageClasspath Entry: io.netty:netty-transport:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/transport/target/netty-transport-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2749618Z [WARNING] jar:file:///code/transport/target/netty-transport-4.1.82.Final-SNAPSHOT.jar!/META-INF/native-image/io.netty/transport/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
2022-09-11T02:23:41.2750776Z [INFO] ImageClasspath Entry: io.netty:netty-common:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/common/target/netty-common-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2751780Z [WARNING] jar:file:///code/common/target/netty-common-4.1.82.Final-SNAPSHOT.jar!/META-INF/native-image/io.netty/common/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
2022-09-11T02:23:41.2752705Z [INFO] ImageClasspath Entry: io.netty:netty-buffer:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/buffer/target/netty-buffer-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2753697Z [WARNING] jar:file:///code/buffer/target/netty-buffer-4.1.82.Final-SNAPSHOT.jar!/META-INF/native-image/io.netty/buffer/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
2022-09-11T02:23:41.2754787Z [INFO] ImageClasspath Entry: io.netty:netty-resolver:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/resolver/target/netty-resolver-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2755631Z [INFO] ImageClasspath Entry: io.netty:netty-resolver-dns:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/resolver-dns/target/netty-resolver-dns-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2756704Z [WARNING] jar:file:///code/resolver-dns/target/netty-resolver-dns-4.1.82.Final-SNAPSHOT.jar!/META-INF/native-image/io.netty/resolver-dns/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
2022-09-11T02:23:41.2757649Z [INFO] ImageClasspath Entry: io.netty:netty-codec:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/codec/target/netty-codec-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2758431Z [INFO] ImageClasspath Entry: io.netty:netty-codec-dns:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/codec-dns/target/netty-codec-dns-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2759217Z [INFO] ImageClasspath Entry: io.netty:netty-handler:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/handler/target/netty-handler-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2760230Z [WARNING] jar:file:///code/handler/target/netty-handler-4.1.82.Final-SNAPSHOT.jar!/META-INF/native-image/io.netty/handler/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
2022-09-11T02:23:41.2761453Z [INFO] ImageClasspath Entry: io.netty:netty-transport-native-unix-common:jar:4.1.82.Final-SNAPSHOT:compile (file:///code/transport-native-unix-common/target/netty-transport-native-unix-common-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.2762599Z [INFO] ImageClasspath Entry: io.netty:netty-testsuite-native-image-client:jar:4.1.82.Final-SNAPSHOT (file:///code/testsuite-native-image-client/target/netty-testsuite-native-image-client-4.1.82.Final-SNAPSHOT.jar)
2022-09-11T02:23:41.4392193Z [WARNING] Version mismatch between native-image-maven-plugin (19.3.6) and native-image executable (Unknown)
2022-09-11T02:23:41.4402053Z [INFO] Executing: /root/.sdkman/candidates/java/20.3.6.r11-grl/bin/native-image -cp /code/transport/target/netty-transport-4.1.82.Final-SNAPSHOT.jar:/code/common/target/netty-common-4.1.82.Final-SNAPSHOT.jar:/code/buffer/target/netty-buffer-4.1.82.Final-SNAPSHOT.jar:/code/resolver/target/netty-resolver-4.1.82.Final-SNAPSHOT.jar:/code/resolver-dns/target/netty-resolver-dns-4.1.82.Final-SNAPSHOT.jar:/code/codec/target/netty-codec-4.1.82.Final-SNAPSHOT.jar:/code/codec-dns/target/netty-codec-dns-4.1.82.Final-SNAPSHOT.jar:/code/handler/target/netty-handler-4.1.82.Final-SNAPSHOT.jar:/code/transport-native-unix-common/target/netty-transport-native-unix-common-4.1.82.Final-SNAPSHOT.jar:/code/testsuite-native-image-client/target/netty-testsuite-native-image-client-4.1.82.Final-SNAPSHOT.jar --report-unsupported-elements-at-runtime --allow-incomplete-classpath --no-fallback --initialize-at-build-time=io.netty -H:ReflectionConfigurationResources=reflection-config.json -H:Class=io.netty.testsuite.svm.client.DnsNativeClient -H:Name=netty-testsuite-native-image-client
2022-09-11T02:23:44.9275465Z [netty-testsuite-native-image-client:34166]    classlist:   2,761.62 ms,  0.96 GB
2022-09-11T02:23:46.0902344Z [netty-testsuite-native-image-client:34166]        (cap):     615.37 ms,  0.96 GB
2022-09-11T02:23:46.1280570Z WARNING: Unknown attribute(s) [condition, queryAllPublicMethods] in reflection class descriptor object
2022-09-11T02:23:47.1603868Z [netty-testsuite-native-image-client:34166]        setup:   2,214.34 ms,  0.96 GB
2022-09-11T02:23:59.5569076Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkEncoder;.
2022-09-11T02:23:59.5581236Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Deflater;.
2022-09-11T02:23:59.5589954Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzmaFrameEncoder. Reason: java.lang.NoClassDefFoundError: Llzma/sdk/lzma/Encoder;.
2022-09-11T02:23:59.5608314Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/encoder/Encoder$Parameters;.
2022-09-11T02:23:59.5629342Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoderNano. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/nano/MessageNano.
2022-09-11T02:23:59.5637261Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:23:59.5651442Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:23:59.5659396Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufDecoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
2022-09-11T02:23:59.5672007Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameEncoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:23:59.5681477Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/decoder/DecoderJNI$Wrapper;.
2022-09-11T02:23:59.5689344Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Inflater;.
2022-09-11T02:23:59.5710853Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameDecoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:23:59.5729252Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:23:59.5736974Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:23:59.5748833Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkDecoder;.
2022-09-11T02:23:59.5766973Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/MessageLiteOrBuilder.
2022-09-11T02:23:59.5859241Z Warning: class initialization of class io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder failed with exception java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder to explicitly request delayed initialization of this class.
2022-09-11T02:23:59.5941755Z Warning: class initialization of class io.netty.handler.codec.marshalling.MarshallingDecoder failed with exception java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.handler.codec.marshalling.MarshallingDecoder to explicitly request delayed initialization of this class.
2022-09-11T02:23:59.5944072Z Warning: class initialization of class io.netty.handler.codec.protobuf.ProtobufDecoder failed with exception java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.handler.codec.protobuf.ProtobufDecoder to explicitly request delayed initialization of this class.
2022-09-11T02:23:59.5992381Z Warning: class initialization of class io.netty.handler.codec.compression.Lz4FrameEncoder failed with exception java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.handler.codec.compression.Lz4FrameEncoder to explicitly request delayed initialization of this class.
2022-09-11T02:23:59.6139060Z Warning: class initialization of class io.netty.handler.codec.compression.Lz4FrameDecoder failed with exception java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.handler.codec.compression.Lz4FrameDecoder to explicitly request delayed initialization of this class.
2022-09-11T02:23:59.6147063Z Warning: class initialization of class io.netty.handler.codec.marshalling.MarshallingEncoder failed with exception java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.handler.codec.marshalling.MarshallingEncoder to explicitly request delayed initialization of this class.
2022-09-11T02:23:59.6152097Z Warning: class initialization of class io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder failed with exception java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder to explicitly request delayed initialization of this class.
2022-09-11T02:23:59.7998478Z Warning: class initialization of class io.netty.util.internal.logging.Slf4JLoggerFactory$NopInstanceHolder failed with exception java.lang.NoClassDefFoundError: Could not initialize class io.netty.util.internal.logging.Slf4JLoggerFactory$NopInstanceHolder. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.util.internal.logging.Slf4JLoggerFactory$NopInstanceHolder to explicitly request delayed initialization of this class.
2022-09-11T02:24:00.3485500Z Warning: class initialization of class io.netty.util.internal.logging.Log4JLogger failed with exception java.lang.NoClassDefFoundError: org/apache/log4j/Priority. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=io.netty.util.internal.logging.Log4JLogger to explicitly request delayed initialization of this class.
2022-09-11T02:24:04.9501972Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkEncoder;.
2022-09-11T02:24:04.9517544Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Deflater;.
2022-09-11T02:24:04.9521693Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzmaFrameEncoder. Reason: java.lang.NoClassDefFoundError: Llzma/sdk/lzma/Encoder;.
2022-09-11T02:24:04.9569867Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/encoder/Encoder$Parameters;.
2022-09-11T02:24:04.9578014Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoderNano. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/nano/MessageNano.
2022-09-11T02:24:04.9581798Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:04.9591120Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:04.9611260Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufDecoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
2022-09-11T02:24:04.9621189Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameEncoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:04.9625963Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/decoder/DecoderJNI$Wrapper;.
2022-09-11T02:24:04.9630016Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Inflater;.
2022-09-11T02:24:04.9723795Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameDecoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:04.9734351Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:04.9738471Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:04.9743956Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkDecoder;.
2022-09-11T02:24:04.9750440Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/MessageLiteOrBuilder.
2022-09-11T02:24:07.3283930Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkEncoder;.
2022-09-11T02:24:07.3287983Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Deflater;.
2022-09-11T02:24:07.3292204Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzmaFrameEncoder. Reason: java.lang.NoClassDefFoundError: Llzma/sdk/lzma/Encoder;.
2022-09-11T02:24:07.3298782Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/encoder/Encoder$Parameters;.
2022-09-11T02:24:07.3306336Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoderNano. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/nano/MessageNano.
2022-09-11T02:24:07.3310170Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:07.3316054Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:07.3320203Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufDecoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
2022-09-11T02:24:07.3326245Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameEncoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:07.3330457Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/decoder/DecoderJNI$Wrapper;.
2022-09-11T02:24:07.3333937Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Inflater;.
2022-09-11T02:24:07.3343253Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameDecoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:07.3350543Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:07.3351529Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:07.3358670Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkDecoder;.
2022-09-11T02:24:07.3371827Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/MessageLiteOrBuilder.
2022-09-11T02:24:08.6748278Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkEncoder;.
2022-09-11T02:24:08.6773534Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Deflater;.
2022-09-11T02:24:08.6776302Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzmaFrameEncoder. Reason: java.lang.NoClassDefFoundError: Llzma/sdk/lzma/Encoder;.
2022-09-11T02:24:08.6777503Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/encoder/Encoder$Parameters;.
2022-09-11T02:24:08.6781713Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoderNano. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/nano/MessageNano.
2022-09-11T02:24:08.6782562Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:08.6786701Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:08.6787498Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufDecoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
2022-09-11T02:24:08.6792843Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameEncoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:08.6793643Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/decoder/DecoderJNI$Wrapper;.
2022-09-11T02:24:08.6794417Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Inflater;.
2022-09-11T02:24:08.6797875Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameDecoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:08.6804316Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:08.6805193Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:08.6806345Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkDecoder;.
2022-09-11T02:24:08.6809189Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/MessageLiteOrBuilder.
2022-09-11T02:24:10.3713597Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkEncoder;.
2022-09-11T02:24:10.3714434Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Deflater;.
2022-09-11T02:24:10.3717973Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzmaFrameEncoder. Reason: java.lang.NoClassDefFoundError: Llzma/sdk/lzma/Encoder;.
2022-09-11T02:24:10.3721025Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliEncoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/encoder/Encoder$Parameters;.
2022-09-11T02:24:10.3724124Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoderNano. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/nano/MessageNano.
2022-09-11T02:24:10.3728960Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:10.3732104Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingDecoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
2022-09-11T02:24:10.3736908Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufDecoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
2022-09-11T02:24:10.3737697Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameEncoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:10.3738487Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.BrotliDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/aayushatharva/brotli4j/decoder/DecoderJNI$Wrapper;.
2022-09-11T02:24:10.3739263Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.JZlibDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/jcraft/jzlib/Inflater;.
2022-09-11T02:24:10.3777983Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.Lz4FrameDecoder. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
2022-09-11T02:24:10.3778866Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.MarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:10.3779702Z WARNING: Could not register reflection metadata for io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
2022-09-11T02:24:10.3780653Z WARNING: Could not register reflection metadata for io.netty.handler.codec.compression.LzfDecoder. Reason: java.lang.NoClassDefFoundError: Lcom/ning/compress/lzf/ChunkDecoder;.
2022-09-11T02:24:10.3781426Z WARNING: Could not register reflection metadata for io.netty.handler.codec.protobuf.ProtobufEncoder. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/MessageLiteOrBuilder.
2022-09-11T02:24:12.4488984Z [netty-testsuite-native-image-client:34166]     (clinit):     437.12 ms,  2.30 GB
2022-09-11T02:24:12.5020876Z [netty-testsuite-native-image-client:34166]   (typeflow):  13,173.77 ms,  2.30 GB
2022-09-11T02:24:12.5021455Z [netty-testsuite-native-image-client:34166]    (objects):  10,853.56 ms,  2.30 GB
2022-09-11T02:24:12.5021965Z [netty-testsuite-native-image-client:34166]   (features):     423.49 ms,  2.30 GB
2022-09-11T02:24:12.5022466Z [netty-testsuite-native-image-client:34166]     analysis:  25,234.82 ms,  2.30 GB
2022-09-11T02:24:12.5047136Z Error: Class initialization of io.netty.handler.codec.compression.BrotliDecoder failed. Use the option --initialize-at-run-time=io.netty.handler.codec.compression.BrotliDecoder to explicitly request delayed initialization of this class.
2022-09-11T02:24:12.5047883Z Detailed message:
2022-09-11T02:24:12.5056137Z 
2022-09-11T02:24:12.5056608Z Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
2022-09-11T02:24:12.5464077Z Error: Image build request failed with exit status 1
2022-09-11T02:24:12.5495053Z [INFO] ------------------------------------------------------------------------
2022-09-11T02:24:12.5502787Z [INFO] Reactor Summary for Netty 4.1.82.Final-SNAPSHOT:
2022-09-11T02:24:12.5503064Z [INFO] 
2022-09-11T02:24:12.5509345Z [INFO] Netty/Dev-Tools .................................... SUCCESS [  1.518 s]
2022-09-11T02:24:12.5509696Z [INFO] Netty .............................................. SUCCESS [  5.888 s]
2022-09-11T02:24:12.5510002Z [INFO] Netty/Common ....................................... SUCCESS [01:42 min]
2022-09-11T02:24:12.5510316Z [INFO] Netty/Buffer ....................................... SUCCESS [01:50 min]
2022-09-11T02:24:12.5515345Z [INFO] Netty/Resolver ..................................... SUCCESS [  5.803 s]
2022-09-11T02:24:12.5515706Z [INFO] Netty/Transport .................................... SUCCESS [01:03 min]
2022-09-11T02:24:12.5519213Z [INFO] Netty/Codec ........................................ SUCCESS [03:45 min]
2022-09-11T02:24:12.5523295Z [INFO] Netty/Codec/DNS .................................... SUCCESS [  7.310 s]
2022-09-11T02:24:12.5523651Z [INFO] Netty/Codec/HAProxy ................................ SUCCESS [  8.669 s]
2022-09-11T02:24:12.5527040Z [INFO] Netty/Transport/Native/Unix/Common ................. SUCCESS [  6.966 s]
2022-09-11T02:24:12.5527861Z [INFO] Netty/Handler ...................................... SUCCESS [23:21 min]
2022-09-11T02:24:12.5531256Z [INFO] Netty/Codec/HTTP ................................... SUCCESS [ 33.884 s]
2022-09-11T02:24:12.5532027Z [INFO] Netty/Codec/HTTP2 .................................. SUCCESS [ 36.874 s]
2022-09-11T02:24:12.5532381Z [INFO] Netty/Codec/Memcache ............................... SUCCESS [  6.770 s]
2022-09-11T02:24:12.5580607Z [INFO] Netty/Codec/MQTT ................................... SUCCESS [  7.876 s]
2022-09-11T02:24:12.5583807Z [INFO] Netty/Codec/Redis .................................. SUCCESS [  6.186 s]
2022-09-11T02:24:12.5587403Z [INFO] Netty/Codec/SMTP ................................... SUCCESS [  5.714 s]
2022-09-11T02:24:12.5590520Z [INFO] Netty/Codec/Socks .................................. SUCCESS [  7.893 s]
2022-09-11T02:24:12.5594279Z [INFO] Netty/Codec/Stomp .................................. SUCCESS [  6.173 s]
2022-09-11T02:24:12.5594619Z [INFO] Netty/Codec/XML .................................... SUCCESS [  5.836 s]
2022-09-11T02:24:12.5599716Z [INFO] Netty/Handler/Proxy ................................ SUCCESS [ 16.416 s]
2022-09-11T02:24:12.5600678Z [INFO] Netty/Resolver/DNS ................................. SUCCESS [ 52.334 s]
2022-09-11T02:24:12.5601213Z [INFO] Netty/Transport/RXTX ............................... SUCCESS [  3.047 s]
2022-09-11T02:24:12.5601560Z [INFO] Netty/Transport/SCTP ............................... SUCCESS [  7.537 s]
2022-09-11T02:24:12.5601888Z [INFO] Netty/Transport/UDT ................................ SUCCESS [ 21.481 s]
2022-09-11T02:24:12.5602211Z [INFO] Netty/Transport/Classes/Epoll ...................... SUCCESS [  5.472 s]
2022-09-11T02:24:12.5609069Z [INFO] Netty/Transport/Classes/KQueue ..................... SUCCESS [  4.792 s]
2022-09-11T02:24:12.5609440Z [INFO] Netty/Resolver/DNS/Classes/MacOS ................... SUCCESS [  2.973 s]
2022-09-11T02:24:12.5609949Z [INFO] Netty/All-in-One ................................... SUCCESS [  2.291 s]
2022-09-11T02:24:12.5610285Z [INFO] Netty/Resolver/DNS/Native/MacOS .................... SUCCESS [  3.218 s]
2022-09-11T02:24:12.5610635Z [INFO] Netty/Transport/Native/Unix/Common/Tests ........... SUCCESS [  3.223 s]
2022-09-11T02:24:12.5610969Z [INFO] Netty/Testsuite .................................... SUCCESS [17:54 min]
2022-09-11T02:24:12.5611288Z [INFO] Netty/Transport/Native/Epoll ....................... SUCCESS [07:54 min]
2022-09-11T02:24:12.5611623Z [INFO] Netty/Transport/Native/KQueue ...................... SUCCESS [  2.972 s]
2022-09-11T02:24:12.5611952Z [INFO] Netty/Example ...................................... SUCCESS [ 13.217 s]
2022-09-11T02:24:12.5612275Z [INFO] Netty/Testsuite/Autobahn ........................... SUCCESS [04:14 min]
2022-09-11T02:24:12.5612754Z [INFO] Netty/Testsuite/Http2 .............................. SUCCESS [ 21.836 s]
2022-09-11T02:24:12.5613187Z [INFO] Netty/Testsuite/OSGI ............................... SUCCESS [  2.328 s]
2022-09-11T02:24:12.5613526Z [INFO] Netty/Testsuite/Shading ............................ SUCCESS [  7.803 s]
2022-09-11T02:24:12.5613959Z [INFO] Netty/Testsuite/Native ............................. SUCCESS [  3.536 s]
2022-09-11T02:24:12.5614289Z [INFO] Netty/Testsuite/NativeImage ........................ SUCCESS [01:05 min]
2022-09-11T02:24:12.5614629Z [INFO] Netty/Testsuite/NativeImage/Client ................. FAILURE [ 33.315 s]
2022-09-11T02:24:12.5614984Z [INFO] Netty/Testsuite/NativeImage/ClientRuntimeInit ...... SKIPPED
2022-09-11T02:24:12.5615328Z [INFO] Netty/Transport/BlockHound/Tests ................... SKIPPED
2022-09-11T02:24:12.5615626Z [INFO] Netty/Microbench ................................... SKIPPED
2022-09-11T02:24:12.5615922Z [INFO] Netty/BOM .......................................... SKIPPED
2022-09-11T02:24:12.5616371Z [INFO] ------------------------------------------------------------------------
2022-09-11T02:24:12.5616676Z [INFO] BUILD FAILURE
2022-09-11T02:24:12.5617072Z [INFO] ------------------------------------------------------------------------
2022-09-11T02:24:12.5649210Z [INFO] Total time:  01:08 h
2022-09-11T02:24:12.5649755Z [INFO] Finished at: 2022-09-11T02:24:12Z
2022-09-11T02:24:12.5650248Z [INFO] ------------------------------------------------------------------------
2022-09-11T02:24:12.5654143Z [ERROR] Failed to execute goal org.graalvm.nativeimage:native-image-maven-plugin:19.3.6:native-image (default) on project netty-testsuite-native-image-client: Execution of /root/.sdkman/candidates/java/20.3.6.r11-grl/bin/native-image -cp /code/transport/target/netty-transport-4.1.82.Final-SNAPSHOT.jar:/code/common/target/netty-common-4.1.82.Final-SNAPSHOT.jar:/code/buffer/target/netty-buffer-4.1.82.Final-SNAPSHOT.jar:/code/resolver/target/netty-resolver-4.1.82.Final-SNAPSHOT.jar:/code/resolver-dns/target/netty-resolver-dns-4.1.82.Final-SNAPSHOT.jar:/code/codec/target/netty-codec-4.1.82.Final-SNAPSHOT.jar:/code/codec-dns/target/netty-codec-dns-4.1.82.Final-SNAPSHOT.jar:/code/handler/target/netty-handler-4.1.82.Final-SNAPSHOT.jar:/code/transport-native-unix-common/target/netty-transport-native-unix-common-4.1.82.Final-SNAPSHOT.jar:/code/testsuite-native-image-client/target/netty-testsuite-native-image-client-4.1.82.Final-SNAPSHOT.jar --report-unsupported-elements-at-runtime --allow-incomplete-classpath --no-fallback --initialize-at-build-time=io.netty -H:ReflectionConfigurationResources=reflection-config.json -H:Class=io.netty.testsuite.svm.client.DnsNativeClient -H:Name=netty-testsuite-native-image-client returned non-zero result -> [Help 1]
2022-09-11T02:24:12.5656689Z [ERROR] 
2022-09-11T02:24:12.5657077Z [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
2022-09-11T02:24:12.5657540Z [ERROR] Re-run Maven using the -X switch to enable full debug logging.
2022-09-11T02:24:12.5657819Z [ERROR] 
2022-09-11T02:24:12.5658155Z [ERROR] For more information about the errors and possible solutions, please read the following articles:
2022-09-11T02:24:12.5658620Z [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
2022-09-11T02:24:12.5658936Z [ERROR] 
2022-09-11T02:24:12.5659210Z [ERROR] After correcting the problems, you can resume the build with the command
2022-09-11T02:24:12.5659665Z [ERROR]   mvn <args> -rf :netty-testsuite-native-image-client

@gradinac

Copy link
Copy Markdown
Contributor Author

@chrisvest Thank you for looking into this :)
The failure seems to be caused by forcing runtime initialization of the BrotliDecoder in the codec-http subproject instead of the codec project where this decoder is located - I've pushed a fix to the PR and I'll check if it passes

@gradinac gradinac force-pushed the gradinac/fix-netty-4-handler-metadata branch from 217efe1 to 21787a8 Compare September 26, 2022 17:43
@chrisvest chrisvest merged commit 5327fae into netty:4.1 Sep 26, 2022
@chrisvest

Copy link
Copy Markdown
Member

Thanks!

@chrisvest chrisvest added this to the 4.1.83.Final milestone Sep 26, 2022
@gradinac

Copy link
Copy Markdown
Contributor Author

Thank you very much for merging this! :) Sorry for not looking into this PR further earlier, I think it was stuck on some transient issue - I had rebased it and re-run the workflows and they've passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native builds using GraalVM 22.2 throw NoSuchMethodException at runtime

2 participants