-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native Image failure building Kafka #8914
Comments
IMHO this issue could be wrong described because it says that Kafka is the cause of the native image failure, when the root cause is use Avro classes, right? This issue is still running with the following dependencies:
The Native Image failure in this scenario is:
Quarkus Avro extension is seems experimental, where I can find information about this extension? I only found this blog |
Hello, I have the same problem, I have a project that has 3 modules:
When I run the module to produce the integration tests I get the same error as @rmarting, while consumer module works correctly in mode native. [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] /Users/chabir/.sdkman/candidates/java/20.2.0.r11-grl/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Davro.disable.unsafe=true -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=es -J-Dfile.encoding=UTF-8 -H:-ParseRuntimeOptions -H:+TraceClassInitialization -H:GenerateDebugInfo=1 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -H:+JNI -jar quarkus-producer-1.0.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http --no-server -H:-UseServiceLoaderFeature -H:+StackTrace quarkus-producer-1.0.0-SNAPSHOT-runner [quarkus-producer-1.0.0-SNAPSHOT-runner:50981] classlist: 12,652.06 ms, 1.68 GB com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
|
I am still seeing this error in Quarkus 1.12.0.Final. Any recommendations? Stacktrace [kafka-quickstart-1.0-SNAPSHOT-runner:27652] analysis: 60,748.99 ms, 4.43 GB
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image runtime. To see how this object got instantiated use --trace-object-instantiation=com.oracle.svm.hosted.NativeImageGenerator$1. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Trace: Object was reached by
reading field org.apache.avro.generic.GenericDatumReader.creator of
constant org.apache.avro.specific.SpecificDatumReader@39f7a6db reached by
reading field org.acme.kafka.Movie.READER$
com.oracle.svm.core.util.UserError$UserException: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image runtime. To see how this object got instantiated use --trace-object-instantiation=com.oracle.svm.hosted.NativeImageGenerator$1. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Trace: Object was reached by
reading field org.apache.avro.generic.GenericDatumReader.creator of
constant org.apache.avro.specific.SpecificDatumReader@39f7a6db reached by
reading field org.acme.kafka.Movie.READER$
at com.oracle.svm.core.util.UserError.abort(UserError.java:82) Configuration mp.messaging.outgoing.movies.connector=smallrye-kafka
mp.messaging.outgoing.movies.value.serializer=io.confluent.kafka.serializers.KafkaAvroSerializer
mp.messaging.outgoing.movies.schema.registry.url=${kafka.schema.registry.url}
mp.messaging.outgoing.movies.specific.avro.reader=true
mp.messaging.incoming.movies-from-kafka.connector=smallrye-kafka
mp.messaging.incoming.movies-from-kafka.topic=movies
mp.messaging.incoming.movies-from-kafka.value.deserializer=io.confluent.kafka.serializers.KafkaAvroDeserializer
mp.messaging.incoming.movies-from-kafka.auto.offset.reset=earliest
mp.messaging.incoming.movies-from-kafka.enable.auto.commit=false
mp.messaging.incoming.movies-from-kafka.group.id=movies
mp.messaging.incoming.movies-from-kafka.schema.registry.url=${kafka.schema.registry.url}
mp.messaging.incoming.movies-from-kafka.specific.avro.reader=true |
Are you sing the Quarkus Avro extension? If so, please provide a reproducer attached to a new issue. |
My bad, I was missing that dependency. Thanks for pointing me to it. Curious, how in JVM mode its working without that dependency? |
A Quarkus extension is more than a dependency. It collects metadata on your application and compute the right configuration to provide to the native compiler. |
As mentioned here: oracle/graal#2379 (comment)
Building Quarkus using NI, where graal has been built with JDK8, Kaftka fails to build as native image
Machine: Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-142-generic x86_64)
Quarkus: a527712
Graal: b47aaf4
OpenJDK: openjdk1.8.0_242-jvmci-20.0-b02
$ mvn install -Dnative -Dquarkus.native.additional-build-args=-H:GenerateDebugInfo=1 -rf :quarkus-integration-test-kafka
Full log files attached.
kafka.log
kafka.out.txt
The text was updated successfully, but these errors were encountered: