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

Quarkus AWT with Native Build Failure #4769

Open
dilipdhankecha2530 opened this issue Jul 29, 2022 · 12 comments
Open

Quarkus AWT with Native Build Failure #4769

dilipdhankecha2530 opened this issue Jul 29, 2022 · 12 comments
Assignees
Labels
bug native-image quarkus quarkus related issue

Comments

@dilipdhankecha2530
Copy link

dilipdhankecha2530 commented Jul 29, 2022

Describe the issue
When we are using quarkus-awt with native build then it gives us the failure response.

22.1-java17: Pulling from quarkus/ubi-quarkus-native-image
Digest: sha256:3d5dd675ced8005a2530019e1acc69641ae67ebd73fa7facfd038e1061d24152
Status: Image is up to date for quay.io/quarkus/ubi-quarkus-native-image:22.1-java17
quay.io/quarkus/ubi-quarkus-native-image:22.1-java17
Running Quarkus native-image plugin on GraalVM 22.1.0 Java 17 CE (Java Version 17.0.3+7-jvmci-22.1-b06)
docker run --env LANG=C --rm --user 1000:1000 -v /home/dilip/Desktop/image-processor/build/image-processor-1.0.0-SNAPSHOT-native-image-source-jar:/project:z --name build-native-mzjWv quay.io/quarkus/ubi-quarkus-native-image:22.1-java17 -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=IN -J-Dfile.encoding=UTF-8 --features=io.quarkus.awt.runtime.graal.AwtFeature,io.quarkus.awt.runtime.graal.DarwinAwtFeature,io.quarkus.runner.Feature,io.quarkus.runtime.graal.ResourcesFeature,io.quarkus.runtime.graal.DisableLoggingFeature -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED --initialize-at-run-time=org.apache.pdfbox.rendering.SoftMask --initialize-at-run-time=org.apache.pdfbox.pdmodel.graphics.color.PDCIEDictionaryBasedColorSpace,org.apache.pdfbox.pdmodel.encryption.PublicKeySecurityHandler -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -J-Djava.awt.headless=true -H:FallbackThreshold=0 --link-at-build-time -H:+ReportExceptionStackTraces -J-Xmx6g -H:-AddAllCharsets -H:EnableURLProtocols=http,https -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace image-processor-1.0.0-SNAPSHOT-runner -jar image-processor-1.0.0-SNAPSHOT-runner.jar
========================================================================================================================
GraalVM Native Image: Generating 'image-processor-1.0.0-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                    (4.8s @ 0.16GB)
 Version info: 'GraalVM 22.1.0 Java 17 CE'
 C compiler: gcc (redhat, x86_64, 8.5.0)
 Garbage collector: Serial GC
 5 user-provided feature(s)
  - io.quarkus.awt.runtime.graal.AwtFeature
  - io.quarkus.awt.runtime.graal.DarwinAwtFeature
  - io.quarkus.runner.Feature
  - io.quarkus.runtime.graal.DisableLoggingFeature
  - io.quarkus.runtime.graal.ResourcesFeature
06:47:16,205 WARN  [org.apa.pdf.pdm.fon.FileSystemFontProvider] New fonts found, font cache will be re-built
06:47:16,210 WARN  [org.apa.pdf.pdm.fon.FileSystemFontProvider] Building on-disk font cache, this may take a while
06:47:16,314 WARN  [org.apa.pdf.pdm.fon.FileSystemFontProvider] Finished building on-disk font cache, found 9 fonts
06:47:16,314 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Times-Roman
06:47:16,333 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Times-Bold
06:47:16,347 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Times-Italic
06:47:16,371 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Times-BoldItalic
06:47:16,377 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Helvetica
06:47:16,392 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Helvetica-Bold
06:47:16,405 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Helvetica-Oblique
06:47:16,423 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Helvetica-BoldOblique
06:47:16,430 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Courier
06:47:16,447 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Courier-Bold
06:47:16,464 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Courier-Oblique
06:47:16,471 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Courier-BoldOblique
06:47:16,493 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font Symbol
06:47:16,520 WARN  [org.apa.pdf.pdm.fon.PDType1Font] Using fallback font LiberationSans for base font ZapfDingbats
To see how the classes got initialized, use --trace-class-initialization=java.awt.image.DataBufferByte,sun.awt.image.IntegerInterleavedRaster,java.awt.image.DataBufferInt,java.awt.image.ComponentSampleModel,sun.java2d.StateTrackableDelegate$2,java.awt.image.BandedSampleModel,java.awt.Image,java.awt.color.ColorSpace$BuiltInSpace,java.awt.image.ColorModel,sun.java2d.StateTrackableDelegate,java.awt.image.SinglePixelPackedSampleModel,java.awt.image.DirectColorModel,java.awt.Toolkit,sun.awt.image.IntegerComponentRaster,sun.awt.image.ByteBandedRaster,java.awt.Rectangle,java.awt.image.BufferedImage,java.awt.image.SampleModel,java.awt.image.WritableRaster,java.awt.image.DataBuffer,java.awt.image.Raster,java.awt.image.PackedColorModel,sun.awt.image.SunWritableRaster
[2/7] Performing analysis...  [*]                                                                       (69.8s @ 2.43GB)
  12,281 (88.74%) of 13,840 classes reachable
  20,104 (59.54%) of 33,764 fields reachable
  72,819 (69.36%) of 104,990 methods reachable
     329 classes,    40 fields, and   622 methods registered for reflection

Error: Classes that should be initialized at run time got initialized during image building:
 java.awt.image.DataBufferByte the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DataBufferByte got initialized use --trace-class-initialization=java.awt.image.DataBufferByte
sun.awt.image.IntegerInterleavedRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.IntegerInterleavedRaster got initialized use --trace-class-initialization=sun.awt.image.IntegerInterleavedRaster
java.awt.image.DataBufferInt the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DataBufferInt got initialized use --trace-class-initialization=java.awt.image.DataBufferInt
java.awt.image.ComponentSampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.ComponentSampleModel got initialized use --trace-class-initialization=java.awt.image.ComponentSampleModel
sun.java2d.StateTrackableDelegate$2 the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.java2d.StateTrackableDelegate$2 got initialized use --trace-class-initialization=sun.java2d.StateTrackableDelegate$2
java.awt.image.BandedSampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.BandedSampleModel got initialized use --trace-class-initialization=java.awt.image.BandedSampleModel
java.awt.Image the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.Image got initialized use --trace-class-initialization=java.awt.Image
java.awt.color.ColorSpace$BuiltInSpace the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.color.ColorSpace$BuiltInSpace got initialized use --trace-class-initialization=java.awt.color.ColorSpace$BuiltInSpace
java.awt.image.ColorModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.ColorModel got initialized use --trace-class-initialization=java.awt.image.ColorModel
sun.java2d.StateTrackableDelegate the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.java2d.StateTrackableDelegate got initialized use --trace-class-initialization=sun.java2d.StateTrackableDelegate
java.awt.image.SinglePixelPackedSampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.SinglePixelPackedSampleModel got initialized use --trace-class-initialization=java.awt.image.SinglePixelPackedSampleModel
java.awt.image.DirectColorModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DirectColorModel got initialized use --trace-class-initialization=java.awt.image.DirectColorModel
java.awt.Toolkit the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.Toolkit got initialized use --trace-class-initialization=java.awt.Toolkit
sun.awt.image.IntegerComponentRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.IntegerComponentRaster got initialized use --trace-class-initialization=sun.awt.image.IntegerComponentRaster
sun.awt.image.ByteBandedRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.ByteBandedRaster got initialized use --trace-class-initialization=sun.awt.image.ByteBandedRaster
java.awt.Rectangle the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.Rectangle got initialized use --trace-class-initialization=java.awt.Rectangle
java.awt.image.BufferedImage the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.BufferedImage got initialized use --trace-class-initialization=java.awt.image.BufferedImage
java.awt.image.SampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.SampleModel got initialized use --trace-class-initialization=java.awt.image.SampleModel
java.awt.image.WritableRaster the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.WritableRaster got initialized use --trace-class-initialization=java.awt.image.WritableRaster
java.awt.image.DataBuffer the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DataBuffer got initialized use --trace-class-initialization=java.awt.image.DataBuffer
java.awt.image.Raster the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.Raster got initialized use --trace-class-initialization=java.awt.image.Raster
java.awt.image.PackedColorModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.PackedColorModel got initialized use --trace-class-initialization=java.awt.image.PackedColorModel
sun.awt.image.SunWritableRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.SunWritableRaster got initialized use --trace-class-initialization=sun.awt.image.SunWritableRaster

com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
 java.awt.image.DataBufferByte the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DataBufferByte got initialized use --trace-class-initialization=java.awt.image.DataBufferByte
sun.awt.image.IntegerInterleavedRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.IntegerInterleavedRaster got initialized use --trace-class-initialization=sun.awt.image.IntegerInterleavedRaster
java.awt.image.DataBufferInt the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DataBufferInt got initialized use --trace-class-initialization=java.awt.image.DataBufferInt
java.awt.image.ComponentSampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.ComponentSampleModel got initialized use --trace-class-initialization=java.awt.image.ComponentSampleModel
sun.java2d.StateTrackableDelegate$2 the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.java2d.StateTrackableDelegate$2 got initialized use --trace-class-initialization=sun.java2d.StateTrackableDelegate$2
java.awt.image.BandedSampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.BandedSampleModel got initialized use --trace-class-initialization=java.awt.image.BandedSampleModel
java.awt.Image the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.Image got initialized use --trace-class-initialization=java.awt.Image
java.awt.color.ColorSpace$BuiltInSpace the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.color.ColorSpace$BuiltInSpace got initialized use --trace-class-initialization=java.awt.color.ColorSpace$BuiltInSpace
java.awt.image.ColorModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.ColorModel got initialized use --trace-class-initialization=java.awt.image.ColorModel
sun.java2d.StateTrackableDelegate the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.java2d.StateTrackableDelegate got initialized use --trace-class-initialization=sun.java2d.StateTrackableDelegate
java.awt.image.SinglePixelPackedSampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.SinglePixelPackedSampleModel got initialized use --trace-class-initialization=java.awt.image.SinglePixelPackedSampleModel
java.awt.image.DirectColorModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DirectColorModel got initialized use --trace-class-initialization=java.awt.image.DirectColorModel
java.awt.Toolkit the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.Toolkit got initialized use --trace-class-initialization=java.awt.Toolkit
sun.awt.image.IntegerComponentRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.IntegerComponentRaster got initialized use --trace-class-initialization=sun.awt.image.IntegerComponentRaster
sun.awt.image.ByteBandedRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.ByteBandedRaster got initialized use --trace-class-initialization=sun.awt.image.ByteBandedRaster
java.awt.Rectangle the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.Rectangle got initialized use --trace-class-initialization=java.awt.Rectangle
java.awt.image.BufferedImage the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.BufferedImage got initialized use --trace-class-initialization=java.awt.image.BufferedImage
java.awt.image.SampleModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.SampleModel got initialized use --trace-class-initialization=java.awt.image.SampleModel
java.awt.image.WritableRaster the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.WritableRaster got initialized use --trace-class-initialization=java.awt.image.WritableRaster
java.awt.image.DataBuffer the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.DataBuffer got initialized use --trace-class-initialization=java.awt.image.DataBuffer
java.awt.image.Raster the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.Raster got initialized use --trace-class-initialization=java.awt.image.Raster
java.awt.image.PackedColorModel the class was requested to be initialized at run time (Required for sun.text.bidi.BidiBase.NumericShapings). To see why java.awt.image.PackedColorModel got initialized use --trace-class-initialization=java.awt.image.PackedColorModel
sun.awt.image.SunWritableRaster the class was requested to be initialized at run time (Quarkus run time init for AWT). To see why sun.awt.image.SunWritableRaster got initialized use --trace-class-initialization=sun.awt.image.SunWritableRaster

        at com.oracle.svm.core.util.UserError.abort(UserError.java:72)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.checkDelayedInitialization(ConfigurableClassInitialization.java:560)
        at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:167)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:726)
        at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:74)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$11(NativeImageGenerator.java:726)
        at com.oracle.graal.pointsto.PointsToAnalysis.runAnalysis(PointsToAnalysis.java:751)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:723)
------------------------------------------------------------------------------------------------------------------------
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:558)
        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)
                        4.8s (6.3% of total time) in 25 GCs | Peak RSS: 3.31GB | CPU load: 5.37
========================================================================================================================
Failed generating 'image-processor-1.0.0-SNAPSHOT-runner' after 1m 15s.
Error: Image build request failed with exit status 1

> Task :quarkusBuild FAILED
Watching 32 directories to track changes
Watching 33 directories to track changes
Watching 33 directories to track changes
:quarkusBuild (Thread[Execution worker for ':',5,main]) completed. Took 1 mins 21.632 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [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
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:420)
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:261)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:977)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at java.base/java.lang.Thread.run(Thread.java:833)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

We are use APCHE-PDFBOX with aws lambda and while use this we got some error like,

java.lang.UnsupportedOperationException: Add AWT Quarkus extension to enable Java2D/ImageIO. Additional system libraries such as `freetype' and `fontconfig' might be needed.
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:45)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:335)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272)
at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)

So as per the suggestion we are added quarkus-awt and we got the above error as i mentioned.

Describe GraalVM and your environment:
Currently i am using below Graalvm with jdk.

openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment GraalVM CE 21.3.2 (build 17.0.3+7-jvmci-21.3-b14)
OpenJDK 64-Bit Server VM GraalVM CE 21.3.2 (build 17.0.3+7-jvmci-21.3-b14, mixed mode, sharing)
@fniephaus
Copy link
Member

I believe this is a Quarkus issue. Could you take a look at this please, @zakkak?

@fniephaus fniephaus added the quarkus quarkus related issue label Jul 29, 2022
@zakkak
Copy link
Collaborator

zakkak commented Jul 30, 2022

@galderz can you please have a look as both me and karm are on vacation the coming week(s)? Thanks

@dilipdhankecha2530
Copy link
Author

@galderz
Can you please help me to out?

@galderz
Copy link
Contributor

galderz commented Aug 8, 2022

@dilipdhankecha2530 I'd suggest opening an issue in quarkusio/quarkus and adding a reproducer. It would also help to understand if this new code, or there has a particular change/upgrade that has caused this issue.

@Karm
Copy link
Contributor

Karm commented Aug 8, 2022

It was debated over there: quarkusio/quarkus#26682

I will take a look at what exactly it does. Quarkus AWT Extension enables a specific set of features related to image formats, Java2D image generation and fonts (rendering, manipulation).
Only features covered in the test suite are expected to work: https://github.com/quarkusio/quarkus/tree/main/integration-tests/awt/src

If PDFBOX does something beyond that, it might need its own extension.

@dilipdhankecha2530
Copy link
Author

@Karm
Basically, we are converting PDF to Image with pdfbox library and according to me i don't need Quarkus AWT dependency.
And we are build a native image and upload it on the aws lambda at that time it will come up with error of Quarkus AWT.
so basically could you help me to out from here.

@Karm
Copy link
Contributor

Karm commented Aug 10, 2022

@dilipdhankecha2530 O.K., I have a such app too now. I'll take a look at java.awt.image.DirectColorModel and see now.

@Karm
Copy link
Contributor

Karm commented Aug 10, 2022

@dilipdhankecha2530 The good news is that I made PDFBox to work with Quarkus in Native. The bad news is that there is a lot of delayed runtime init etc. No substitutions necessary though, so I will turn it into a Quick start style of an example and you can use it.

@Karm
Copy link
Contributor

Karm commented Aug 11, 2022

Hello @dilipdhankecha2530 , @galderz
This quickstart demonstrates a basic usage of Apache PDFBox with Quarkus native.

quarkusio/quarkus-quickstarts#1154

I think this issue can be closed.

@zakkak
Copy link
Collaborator

zakkak commented Aug 12, 2022

@Karm in https://github.com/quarkusio/quarkus-quickstarts/pull/1154/files#diff-be7a5914fc45d58d8c9a03bdfbd58bc4de47bf332b55270db7408340dfba17afR4-R18 I see that you are marking a number of classes to be initialized at runtime. Would it make sense to do this in quarkus-awt instead?

@Karm
Copy link
Contributor

Karm commented Aug 12, 2022

@zakkak It would not. These are specific for this particular third party library of Apache PDFBox.
Quarkus AWT deals with JDK runtime capabilities only.

If more changes are required, an Apache PDFBox extension might be warranted. So far, for this particular plain PDF -> PNG conversion, the Quickstart is fine.

@galderz
Copy link
Contributor

galderz commented Aug 16, 2022

I think @zakkak is pointing out an important detail @Karm. Quarkus is meant to help users reduce the need for extra configuration, but this is not something that should be discussed here really. See my comment in quarkusio/quarkus-quickstarts#1154 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug native-image quarkus quarkus related issue
Projects
None yet
Development

No branches or pull requests

5 participants