Skip to content

Unable to create native app with Easy RAG on MacOs (and Windows?) #1490

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

Open
philippart-s opened this issue May 14, 2025 · 20 comments
Open

Unable to create native app with Easy RAG on MacOs (and Windows?) #1490

philippart-s opened this issue May 14, 2025 · 20 comments

Comments

@philippart-s
Copy link
Contributor

Hi,

I'm trying to create a native application with Easy RAG feature but I have the following error:

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.22.2:build (default) on project jarvis: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:331)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:499)
[ERROR] Caused by: java.lang.UnsupportedOperationException: MacOS AWT integration is not ready in Quarkus native-image and would result in java.lang.UnsatisfiedLinkError: Can't load library: awt | java.library.path = [.].
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep$NativeImageInvokerInfo$Builder.build(NativeImageBuildStep.java:1041)
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:279)
[ERROR]         ... 10 more
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I have checked the closed issue #644 but I think it's not the same issue.

It sounds like a MacOs issue, but do you know a way to make it work?

  • Quarkus version: 3.22.2
  • JDK 21
  • GraalVM 21
  • Langchain4J quarkus extension version: 0.26.2
  • Easy RAG version: 0.26.2

Thanks

@geoand
Copy link
Collaborator

geoand commented May 14, 2025

@edeandrea have you seen this recently?

@edeandrea
Copy link
Collaborator

To be honest I haven't, but I also don't think I've tried this exact same thing. Is there a reproducer? If so, I can try it.

@philippart-s
Copy link
Contributor Author

@edeandrea if it helps I can create an project to reproduce the issue.

@edeandrea
Copy link
Collaborator

That would be helpful.

@philippart-s
Copy link
Contributor Author

@edeandrea here is the reproducer: https://github.com/philippart-s/quarkus-easy-rag-issue/tree/main

quarkus dev is ok (but you are missing some config to use it but I think it's not important in that case ;)) and quarkus build --native fails with the error mentioned at the beginning of this issue.

@edeandrea
Copy link
Collaborator

Thanks @philippart-s!

@geoand I see the same issue on my mac.

@geoand
Copy link
Collaborator

geoand commented May 14, 2025

Thanks for checking. @zakkak is this a known issue?

@edeandrea
Copy link
Collaborator

@geoand I can even reproduce in some of my other projects that use OpenAI, so its unrelated to mistral...

It's also unrelated to Quarkus langchain4j - using Quarkus Langchain4j 0.26.2 is ok. Seems to have broken starting with Quarkus 3.21.3. It works fine with Quarkus 3.21.2

@edeandrea
Copy link
Collaborator

@philippart-s if you downgrade the Quarkus version to 3.21.2 it should work.

@philippart-s
Copy link
Contributor Author

@edeandrea if I downgrade to 3.21.2 I have another error:

[WARNING] [io.quarkus.deployment.configuration] Configuration property 'quarkus.package.type' has been deprecated and replaced by: [quarkus.package.jar.enabled, quarkus.package.jar.type, quarkus.native.enabled, quarkus.native.sources-only]
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /Users/sphilipp/Developments/quarkus-easy-rag-issue/target/easy-rag-issue-0.0.1-SNAPSHOT-native-image-source-jar/easy-rag-issue-0.0.1-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /Users/sphilipp/Developments/quarkus-easy-rag-issue/target/easy-rag-issue-0.0.1-SNAPSHOT-native-image-source-jar/easy-rag-issue-0.0.1-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GRAALVM 23.1 JDK 21.0.6+8-LTS-jvmci-23.1-b55
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /Users/sphilipp/.sdkman/candidates/java/21.0.6-graal/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dlogging.initial-configurator.min-level=500 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Duser.language=en -J-Duser.country=FR -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -H:+UnlockExperimentalVMOptions -H:IncludeLocales=en-FR -H:-UnlockExperimentalVMOptions -J-Dfile.encoding=UTF-8 -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED --features=io.quarkus.awt.runtime.graal.DarwinAwtFeature,io.quarkus.awt.runtime.graal.AwtFeature,io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkiverse.poi.runtime.graal.POIFeature,io.quarkus.runtime.graal.SkipConsoleServiceProvidersFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-exports=java.security.jgss/sun.security.jgss=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:+UnlockExperimentalVMOptions -H:BuildOutputJSONFile=easy-rag-issue-0.0.1-SNAPSHOT-runner-build-output-stats.json -H:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:+GenerateBuildArtifactsFile -H:-UnlockExperimentalVMOptions --strict-image-heap -H:+UnlockExperimentalVMOptions -H:+AllowFoldMethods -H:-UnlockExperimentalVMOptions -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-UnlockExperimentalVMOptions -H:+AddAllCharsets --enable-url-protocols=http,https --enable-monitoring=heapdump -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -J--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED --exclude-config io\.netty\.netty-codec /META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json --exclude-config io\.netty\.netty-handler /META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json easy-rag-issue-0.0.1-SNAPSHOT-runner -jar easy-rag-issue-0.0.1-SNAPSHOT-runner.jar
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/ai/djl/api/reflect-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:ResourceConfigurationResources=META-INF/native-image/ai/djl/api/resource-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
Error: Class-path entry file:///Users/sphilipp/Developments/quarkus-easy-rag-issue/target/easy-rag-issue-0.0.1-SNAPSHOT-native-image-source-jar/lib/com.microsoft.onnxruntime.onnxruntime-1.20.0.jar contains class ai.onnxruntime.ValueInfo. This class is part of the image builder itself (in file:///Users/sphilipp/.sdkman/candidates/java/21.0.6-graal/lib/svm/builder/svm-enterprise.jar) and must not be passed via -cp. This can be caused by a fat-jar that illegally includes svm.jar (or graal-sdk.jar) due to its build-time dependency on it. As a workaround, -H:+AllowDeprecatedBuilderClassesOnImageClasspath allows turning this error into a warning. Note that this option is deprecated and will be removed in a future version.
com.oracle.svm.core.util.UserError$UserException: Class-path entry file:///Users/sphilipp/Developments/quarkus-easy-rag-issue/target/easy-rag-issue-0.0.1-SNAPSHOT-native-image-source-jar/lib/com.microsoft.onnxruntime.onnxruntime-1.20.0.jar contains class ai.onnxruntime.ValueInfo. This class is part of the image builder itself (in file:///Users/sphilipp/.sdkman/candidates/java/21.0.6-graal/lib/svm/builder/svm-enterprise.jar) and must not be passed via -cp. This can be caused by a fat-jar that illegally includes svm.jar (or graal-sdk.jar) due to its build-time dependency on it. As a workaround, -H:+AllowDeprecatedBuilderClassesOnImageClasspath allows turning this error into a warning. Note that this option is deprecated and will be removed in a future version.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:75)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoaderSupport.reportBuilderClassesInApplication(NativeImageClassLoaderSupport.java:858)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ImageClassLoader.loadAllClasses(ImageClassLoader.java:105)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:386)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:721)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:143)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:98)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.916 s
[INFO] Finished at: 2025-05-14T17:01:29+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.21.2:build (default) on project easy-rag-issue: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:496)
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:287)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:499)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@edeandrea
Copy link
Collaborator

Thats interesting because it builds fine on my machine :)

@edeandrea
Copy link
Collaborator

Actually - update the version of langchain4j-ovh-ai to 1.0.0-beta3

@edeandrea
Copy link
Collaborator

Actually a minute or 2 after I get this:

Error: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForBody.adapt(HttpServiceMethod.java:215) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy102.toString(Unknown Source)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForResponse.adapt(HttpServiceMethod.java:183) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy102.toString(Unknown Source)
   at root method.(Unknown Source)


com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForBody.adapt(HttpServiceMethod.java:215) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy102.toString(Unknown Source)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForResponse.adapt(HttpServiceMethod.java:183) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy102.toString(Unknown Source)
   at root method.(Unknown Source)


	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:814)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:550)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:539)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:721)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:143)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:98)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForBody.adapt(HttpServiceMethod.java:215) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy102.toString(Unknown Source)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForResponse.adapt(HttpServiceMethod.java:183) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy102.toString(Unknown Source)
   at root method.(Unknown Source)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:129)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:809)
	... 6 more

@philippart-s
Copy link
Contributor Author

If I set the version of langchain4j-ovh-ai to 1.0.0-beta3, I have a compilation error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.291 s
[INFO] Finished at: 2025-05-14T17:08:16+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.21.2:build (default) on project easy-rag-issue: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkiverse.langchain4j.deployment.AiServicesProcessor#watchResourceFiles threw an exception: java.lang.NoClassDefFoundError: dev/langchain4j/model/chat/TokenCountEstimator
[ERROR]         at io.quarkiverse.langchain4j.deployment.LangChain4jDotNames.<clinit>(LangChain4jDotNames.java:49)
[ERROR]         at io.quarkiverse.langchain4j.deployment.AiServicesProcessor.watchResourceFiles(AiServicesProcessor.java:942)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:499)
[ERROR] Caused by: java.lang.ClassNotFoundException: dev.langchain4j.model.chat.TokenCountEstimator
[ERROR]         at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
[ERROR]         at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:225)
[ERROR]         at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:210)
[ERROR]         at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:205)
[ERROR]         at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:569)
[ERROR]         at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:517)
[ERROR]         ... 12 more
[ERROR] 
[ERROR]         [error]: Build step io.quarkiverse.langchain4j.deployment.ToolProcessor#handleTools threw an exception: java.lang.NoClassDefFoundError: Could not initialize class io.quarkiverse.langchain4j.deployment.LangChain4jDotNames
[ERROR]         at io.quarkiverse.langchain4j.deployment.ToolProcessor.ignoreToolMethod(ToolProcessor.java:369)
[ERROR]         at io.quarkiverse.langchain4j.deployment.ToolProcessor.handleTools(ToolProcessor.java:202)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:499)
[ERROR] Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: dev/langchain4j/model/chat/TokenCountEstimator [in thread "build-54"]
[ERROR]         at io.quarkiverse.langchain4j.deployment.LangChain4jDotNames.<clinit>(LangChain4jDotNames.java:49)
[ERROR]         at io.quarkiverse.langchain4j.deployment.AiServicesProcessor.watchResourceFiles(AiServicesProcessor.java:942)
[ERROR]         ... 10 more
[ERROR] 
[ERROR]         [error]: Build step io.quarkiverse.langchain4j.deployment.PromptProcessor#structuredPromptSupport threw an exception: java.lang.NoClassDefFoundError: Could not initialize class io.quarkiverse.langchain4j.deployment.LangChain4jDotNames
[ERROR]         at io.quarkiverse.langchain4j.deployment.PromptProcessor.structuredPromptSupport(PromptProcessor.java:81)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:499)
[ERROR] Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: dev/langchain4j/model/chat/TokenCountEstimator [in thread "build-54"]
[ERROR]         at io.quarkiverse.langchain4j.deployment.LangChain4jDotNames.<clinit>(LangChain4jDotNames.java:49)
[ERROR]         at io.quarkiverse.langchain4j.deployment.AiServicesProcessor.watchResourceFiles(AiServicesProcessor.java:942)
[ERROR]         ... 10 more
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@edeandrea
Copy link
Collaborator

are you doing a clean build after changing versions?

Weird that we're both getting errors, but different ones. In any event, something is broken.

@zakkak
Copy link

zakkak commented May 14, 2025

Thanks for checking. @zakkak is this a known issue?

AFAIK yes, see oracle/graal#4124

The fact that it only pops up on specific versions though is an indication that something is bringing AWT in some cases but not in others.

@geoand
Copy link
Collaborator

geoand commented May 14, 2025

👍🏽

@philippart-s
Copy link
Contributor Author

Hi,

I've created a version without the Easy RAG extension (the code is available here: https://github.com/philippart-s/quarkus-easy-rag-issue/tree/rag-without-easyrag).
I don't know if it's going to help, but I've got another error:

Error: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForBody.adapt(HttpServiceMethod.java:215) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy90.converter(Unknown Source)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForResponse.adapt(HttpServiceMethod.java:183) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy90.converter(Unknown Source)
   at root method.(Unknown Source)


com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForBody.adapt(HttpServiceMethod.java:215) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy90.converter(Unknown Source)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForResponse.adapt(HttpServiceMethod.java:183) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy90.converter(Unknown Source)
   at root method.(Unknown Source)


        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:87)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:815)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:593)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:551)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:539)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:721)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:143)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:98)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForBody.adapt(HttpServiceMethod.java:215) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy90.converter(Unknown Source)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: kotlinx.coroutines.CancellableContinuationImpl. This error is reported at image build time because class retrofit2.KotlinExtensions is registered for linking at image build time by command line and command line.
Error encountered while parsing retrofit2.HttpServiceMethod$SuspendForResponse.adapt(HttpServiceMethod.java:183) 
Parsing context:
   at retrofit2.HttpServiceMethod.invoke(HttpServiceMethod.java:146)
   at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
   at jdk.proxy4.$Proxy90.converter(Unknown Source)
   at root method.(Unknown Source)


        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:129)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:810)
        ... 6 more

@geoand
Copy link
Collaborator

geoand commented May 19, 2025

That error is almost certainly a result of langchain4j-ovh-ai being used

@philippart-s
Copy link
Contributor Author

yes you right, it was a wild goose chase.

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

No branches or pull requests

4 participants