quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.35k stars 2.56k forks source link

Port AWT Extension to Windows #32993

Open Karm opened 1 year ago

Karm commented 1 year ago

Description

Quarkus AWT extension enables server side image processing, e.g. converting formats, color spaces, resizing, generating thumbnails, watermarking, rendering custom fonts as overlays on uploaded images etc. It also empowers extensions like Apache TIKA to read, convert and manipulate PDF files and many other document formats.

The code paths related to JNI state initialization are quite different on Windows and the extension requires refactoring and testing, perhaps even updates in upstream GraalVM/Mandrel.

Implementation ideas

The implementation idea is really the same as with Linux, except Visual Studio or WinDBG (shout out to @stooke :-D ) will be used to track the code paths in AWT native libs.

quarkus-bot[bot] commented 1 year ago

/cc @galderz (mandrel), @zakkak (mandrel)

gian1200 commented 2 months ago

This seems to affect https://github.com/quarkiverse/quarkus-poi, too. I don't use/need pdf handler, but gets the same error on Windows. I handle XSLX only.

Should this be tracked on this issue or a separate one?

Quarkus 3.8.4 quarkus-poi: 2.0.5

...
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GRAALVM 22.3.3 JDK 17.0.8+7-jvmci-22.3-b22
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  56.563 s
[INFO] Finished at: 2024-04-19T19:37:35-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.8.4:build (default) on project viabcp-formularios-reportes: 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:301)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.lang.UnsupportedOperationException: Windows AWT integration is not ready in native-image and would result in java.lang.UnsatisfiedLinkError: no awt in java.library.path.
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep$NativeImageInvokerInfo$Builder.build(NativeImageBuildStep.java:973)
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:248)
[ERROR]         ... 11 more
...