Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.18
-
None
-
None
-
MacOsx 10.14.5, Graal 19.3.0
Description
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
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.
Attachments
Issue Links
- relates to
-
PDFBOX-4548 Update PDType1Font to make PDFBox GraalVM native mode ready
-
- Closed
-