Skip to content
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 packaging fail with kafka-client #16769

Closed
danielpetisme opened this issue Apr 23, 2021 · 1 comment · Fixed by #16800
Closed

Native packaging fail with kafka-client #16769

danielpetisme opened this issue Apr 23, 2021 · 1 comment · Fixed by #16800
Labels
area/kafka kind/bug Something isn't working
Milestone

Comments

@danielpetisme
Copy link
Contributor

Describe the bug

When using the kafka-client extension, the native packaging fail.
The issue is related to a Jackson dependency pulled by Apache Kafka.

If I include the quarkus-jackson extension the native packaging works.

Expected behavior

One should be able to build a native executable with only the kafka-client extension`

Actual behavior

With only the kafka-client extension, the native packaging fail with this stacktrace:

com.oracle.svm.core.util.UserError$UserException: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: com.fasterxml.jackson.databind.ObjectMapper. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
Detailed message:
Trace:
	at parsing org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerUnsecuredJws.toMap(OAuthBearerUnsecuredJws.java:298)
Call path from entry point to org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerUnsecuredJws.toMap(String):
	at org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerUnsecuredJws.toMap(OAuthBearerUnsecuredJws.java:295)
	at org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerUnsecuredJws.<init>(OAuthBearerUnsecuredJws.java:84)
	at org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerUnsecuredLoginCallbackHandler.handleTokenCallback(OAuthBearerUnsecuredLoginCallbackHandler.java:214)
	at com.oracle.svm.reflect.OAuthBearerUnsecuredLoginCallbackHandler_handleTokenCallback_399b57d728591b1f515dac482da0876d596bb59e_576.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:566)
	at java.util.ServiceLoader$ProviderImpl.invokeFactoryMethod(ServiceLoader.java:737)
	at java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:720)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:211)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:164)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:293)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)

	at com.oracle.svm.core.util.UserError.abort(UserError.java:82)
	at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:233)
	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:773)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:563)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:476)
	at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:

  1. Use a GRAALVM distribution
  2. curl https://code.quarkus.io/d?a=kafka-client-native-failure&e=kafka-client&cn=code.quarkus.io -o kafka-client-native-failure.zip && unzip kafka-client-native-failure.zip && cd kafka-client-native-failure && ./mvnw package -Pnative -DskipTests
    You will obtain a failure
    You can compare with the version where Jackson is embedded
    curl https://code.quarkus.io/d?a=kafka-client-with-jackson&e=kafka-client&e=jackson&cn=code.quarkus.io -o kafka-client-with-jackson.zip && unzip kafka-client-with-jackson.zip && cd kafka-client-with-jackson && ./mvnw package -Pnative -DskipTests

Configuration

# Add your application.properties here, if applicable.

Screenshots

(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

Output of uname -a or ver

Darwin C02DV4BPMD6T 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)

GraalVM version (if different from Java)

Quarkus version or git rev

1.3.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/dpetisme/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.10, vendor: GraalVM Community, runtime: /Users/dpetisme/.sdkman/candidates/java/21.0.0.2.r11-grl
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"

Additional context

(Add any other context about the problem here.)

@danielpetisme danielpetisme added the kind/bug Something isn't working label Apr 23, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 23, 2021

/cc @cescoffier

@cescoffier cescoffier self-assigned this Apr 25, 2021
cescoffier added a commit to cescoffier/quarkus that referenced this issue Apr 26, 2021
…tional" dependency and make it mandatory.

This commit also enables the Jackson features unconditionally as the capability will always be present.

Our tests did not catch this issue as all of them had a dependency on quarkus-jackson.

Fix quarkusio#16769
@cescoffier cescoffier removed their assignment Apr 26, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 26, 2021
@gsmet gsmet modified the milestones: 2.0 - main, 1.13.3.Final Apr 26, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 26, 2021
…tional" dependency and make it mandatory.

This commit also enables the Jackson features unconditionally as the capability will always be present.

Our tests did not catch this issue as all of them had a dependency on quarkus-jackson.

Fix quarkusio#16769

(cherry picked from commit d85ae29)
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 26, 2021
…tional" dependency and make it mandatory.

This commit also enables the Jackson features unconditionally as the capability will always be present.

Our tests did not catch this issue as all of them had a dependency on quarkus-jackson.

Fix quarkusio#16769

(cherry picked from commit d85ae29)
@gsmet gsmet modified the milestones: 1.13.3.Final, 1.11.7.Final Apr 29, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 29, 2021
…tional" dependency and make it mandatory.

This commit also enables the Jackson features unconditionally as the capability will always be present.

Our tests did not catch this issue as all of them had a dependency on quarkus-jackson.

Fix quarkusio#16769

(cherry picked from commit d85ae29)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kafka kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants