You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2020/01/21 04:07:00 UTC
[jira] [Commented] (PDFBOX-4746) Graal native-image fails when
including PDFBox
[ https://issues.apache.org/jira/browse/PDFBOX-4746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17019843#comment-17019843 ]
Tilman Hausherr commented on PDFBOX-4746:
-----------------------------------------
Yes we need the jbig2 decoder, also several other imageio plugins. There's another graal related issue too, PDFBOX-4548. This won't happen anytime soon.
> Graal native-image fails when including PDFBox
> ----------------------------------------------
>
> Key: PDFBOX-4746
> URL: https://issues.apache.org/jira/browse/PDFBOX-4746
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.18
> Environment: MacOsx 10.14.5, Graal 19.3.0
> Reporter: Bruno
> Priority: Major
> Fix For: 2.0.19
>
>
> Graal native-image build fails when including PDFBox in project with
> Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-build-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
> Detailed message:
> Trace: object sun.java2d.opengl.OGLRenderQueue$QueueFlusher
> object sun.java2d.opengl.OGLRenderQueue
> field sun.java2d.opengl.OGLRenderQueue.theInstance
>
> How to reproduce:
> String fileName = "Some pdf file.pdf";
> try {
> PDDocument document = PDDocument.load(Paths.get(fileName).toFile());
> } catch(IOException e) {
> e.printStackTrace();
> }
> then compile to native.
> Root cause is the inclusion of JBIG2Filter in org.apache.pdfbox.filter.FilterFactory. Comment this out and the problem goes away. This is possibly due to the fact that JBIG2Filter requires a plug in to be installed which is dynamically loaded. In native-image building all such resources must be known at build time.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org