You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Micronaut kafka native image build error occurs when building within docker
Warnings
WARNING: Could not resolve io.micronaut.configuration.kafka.metrics.ConsumerKafkaMetricsReporter for reflection configuration.
WARNING: Could not resolve io.micronaut.configuration.kafka.metrics.ProducerKafkaMetricsReporter for reflection configuration.
Failure
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call or single field access
Task List
Steps to reproduce provided
Stacktrace (if present) provided
Example that reproduces the problem uploaded to Github
Full description of the issue provided (see below)
Steps to Reproduce
Clone github repository
Run ./mvnw clean install
Run docker build . --network host -t micronaut-app
Expected Behaviour
The native image should build successfully
Actual Behaviour
The native image build fails with following output:
Sending build context to Docker daemon 24.5MB
Step 1/10 : FROM oracle/graalvm-ce:20.1.0-java8 as graalvm
---> fa8819f7526a
Step 2/10 : RUN gu install native-image
---> Using cache
---> fc69ef741138
Step 3/10 : COPY . /home/app/micronaut-kafka-graal-native-image
---> c4406af5d788
Step 4/10 : WORKDIR /home/app/micronaut-kafka-graal-native-image
---> Running in 242b59fe5513
Removing intermediate container 242b59fe5513
---> 9852500d1ee3
Step 5/10 : RUN native-image --no-server --no-fallback --static -cp target/micronaut-kafka-graal-native-image-*.jar
---> Running in 184b483e7244
[micronaut-kafka-graal-native-image:22] classlist: 10,197.00 ms, 2.06 GB
[micronaut-kafka-graal-native-image:22] (cap): 983.43 ms, 2.06 GB
WARNING: Could not resolve io.micronaut.configuration.kafka.metrics.ConsumerKafkaMetricsReporter for reflection configuration.
WARNING: Could not resolve io.micronaut.configuration.kafka.metrics.ProducerKafkaMetricsReporter for reflection configuration.
[micronaut-kafka-graal-native-image:22] setup: 3,545.22 ms, 2.06 GB
[micronaut-kafka-graal-native-image:22] (clinit): 1,603.08 ms, 3.69 GB
[micronaut-kafka-graal-native-image:22] (typeflow): 49,760.49 ms, 3.69 GB
[micronaut-kafka-graal-native-image:22] (objects): 29,392.06 ms, 3.69 GB
[micronaut-kafka-graal-native-image:22] (features): 6,575.06 ms, 3.69 GB
[micronaut-kafka-graal-native-image:22] analysis: 91,660.55 ms, 3.69 GB
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call or single field access. The method handle must be a compile time constant, e.g., be loaded from a `static final` field. Method that contains the method handle invocation: java.lang.invoke.LambdaForm$MH/576509877.invokeExact_MT(Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
Detailed message:
Trace:
at parsing org.apache.kafka.common.utils.ByteBufferUnmapper.unmap(ByteBufferUnmapper.java:81)
Call path from entry point to org.apache.kafka.common.utils.ByteBufferUnmapper.unmap(String, ByteBuffer):
at org.apache.kafka.common.utils.ByteBufferUnmapper.unmap(ByteBufferUnmapper.java:75)
at org.apache.kafka.common.network.SslTransportLayer.close(SslTransportLayer.java:206)
at java.io.FileDescriptor.closeAll(FileDescriptor.java:202)
at java.io.RandomAccessFile.close(RandomAccessFile.java:617)
at sun.nio.ch.FileChannelImpl.implCloseChannel(FileChannelImpl.java:139)
at java.nio.channels.spi.AbstractInterruptibleChannel$1.interrupt(AbstractInterruptibleChannel.java:165)
at java.lang.Thread.interrupt(Thread.java:922)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:514)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
The command '/bin/sh -c native-image --no-server --no-fallback --static -cp target/micronaut-kafka-graal-native-image-*.jar' returned a non-zero code: 1
Micronaut kafka native image build error occurs when building within docker
Warnings
Failure
Task List
Steps to Reproduce
./mvnw clean install
docker build . --network host -t micronaut-app
Expected Behaviour
The native image should build successfully
Actual Behaviour
The native image build fails with following output:
Environment Information
2.0.0
1.8
Example Application
The text was updated successfully, but these errors were encountered: