Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2862

Make PDF Parser GraalVM native mode ready

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.20
    • Fix Version/s: None
    • Component/s: parser
    • Labels:
      None

      Description

      PDF Parser is not Graal native mode ready yet, the following is reported when it is processed as part of Quarkus native mode build:

      Error: Detected a FileDescriptor in the image heap. ....You can manually delay class initialization to image run time by using the option --delay-class-initialization-to-runtime=<class-name>. ...
      Detailed message:
       Trace:     object org.apache.fontbox.ttf.BufferedRandomAccessFile
           object org.apache.fontbox.ttf.RAFDataStream
           object org.apache.fontbox.ttf.TrueTypeFont
           object org.apache.pdfbox.pdmodel.font.PDType1Font
           method org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.verifyOrCreateDefaults()
       Call path from entry point to org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.verifyOrCreateDefaults(): 
           at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.verifyOrCreateDefaults(PDAcroForm.java:106)
           at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.<init>(PDAcroForm.java:93)
           at org.apache.pdfbox.pdmodel.PDDocumentCatalog.getAcroForm(PDDocumentCatalog.java:108)
           at org.apache.tika.parser.pdf.PDFParser.handleXFAOnly(PDFParser.java:534)
           at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:164)
      

       

      See also https://medium.com/graalvm/understanding-class-initialization-in-graalvm-native-image-generation-d765b7e4d6ed

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sergey_beryozkin Sergey Beryozkin
                Reporter:
                sergeyb Sergey Beryozkin
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: