Skip to content

MacOS AWT integration error with quarkus-pdfbox in native image build #48422

@SzymonBartkowiak43

Description

@SzymonBartkowiak43

Describe the bug

When trying to build a native image with quarkus-pdfbox extension on macOS, the build fails with an AWT integration error during native test execution.

Actual behavior

Native image build fails with the following exception:

 What went wrong:
Execution failed for task ':quarkusAppPartsBuild'.
> There was a failure while executing work items
   > A failure occurred while executing io.quarkus.gradle.tasks.worker.BuildWorker
      > io.quarkus.builder.BuildException: Build failure: Build failed due to errors
                [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
                at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:331)
                at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
                at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
                at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
                at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
                at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651)
                at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630)
                at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1622)
                at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589)
                at java.base/java.lang.Thread.run(Thread.java:1583)
                at org.jboss.threads.JBossThread.run(JBossThread.java:501)
        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 = [.].
                at io.quarkus.deployment.pkg.steps.NativeImageBuildStep$NativeImageInvokerInfo$Builder.build(NativeImageBuildStep.java:1041)
                at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:279)

How to Reproduce?

https://github.com/SzymonBartkowiak43/awt-reproducer

  1. Clone the reproducer repository
  2. Run: ./gradlew clean testNative
  3. The build fails with the AWT error shown above
  • OS: macOS
  • Java: Oracle GraalVM 21.0.5
  • GraalVM Native Image: 21.0.5
  • Build Tool: Gradle
  • Quarkus PDFBox Extension: 1.1.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions