Recent change introduced warnings while building native image of MongoDB Client (and possibly others)
See original GitHub issueDescribe the bug
With a recent change native compilation of the MongoDB Client integration test results in warnings.
See https://github.com/quarkusio/quarkus/actions/runs/3523161137/jobs/5909184730#step:12:380
Expected behavior
No warnings should be printed.
Actual behavior
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.protobuf.ProtobufDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.protobuf.ProtobufDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
How to Reproduce?
git clone git@github.com:quarkusio/quarkus.git
cd quarkus
./mvnw -Dquickly -T2
./mvnw -e --settings .github/mvn-settings.xml --fail-at-end \
-f integration-tests -pl mongodb-client \
-Dtest-containers -Dstart-containers \
-Dquarkus.native.native-image-xmx=5g -Dnative \
-Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests \
clean install -DskipDocs \
-Dquarkus.native.container-build=true
Output of uname -a
or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
e67b1333eb51512e031c225c291a50628bc2b23d
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Warning on Connecting to MongoDB with a Node server
7 Answers 7 ... My advice is to leave it as it is (maybe place a warning). The useUnifiedTopology: true option does not...
Read more >graalvm/native-image - Gitter
The issue comes about when running this application with docker, I do not see the start up log messages I expect and I...
Read more >Release Notes for MongoDB Enterprise Kubernetes Operator
Kubernetes Operator version 1.15.1 fixes an issue that prevented the Kubernetes Operator upgrade when managing a TLS-enabled Application Database whose TLS ...
Read more >Spring Native documentation
The Spring AOT plugin performs ahead-of-time transformations required to improve native image compatibility and footprint. Maven. Gradle Groovy.
Read more >All configuration options - Quarkus
AWS Lambda Type Default
AWS Lambda Common Type Default
AWS Lambda Gateway REST API Type Default
Agroal ‑ Database connection pool Type Default
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For my sanity I even used unit tests on the constants to be used:
https://github.com/quarkusio/quarkus/blob/23f43c3d3be6f479f86f697888856a8c65d8136d/extensions/jdbc/jdbc-oracle/deployment/src/test/java/io/quarkus/jdbc/oracle/deployment/RegexMatchTest.java#L18
Yes I’d agree with using
ExcludeConfigBuildItem
; @zakkak see an example here: https://github.com/quarkusio/quarkus/blob/23f43c3d3be6f479f86f697888856a8c65d8136d/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleMetadataOverrides.java#L110-L117needs a bit of fiddling with Regexp 😕 And careful, I had to iterate on the current regex as the regex needs to be passed as command line, not all symbols are valid on Windows so it’s a bit tricky.