Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2412

Loading XFDF document fails with ClassCastException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.7, 2.0.0
    • 1.8.8, 2.0.0
    • Parsing
    • MacOS X 10.9.5, Java 1.7.0_65

    Description

      When loading the the this XFDF Document

      <?xml version="1.0" encoding="UTF-8"?>
      <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
      <fields>
      <field name="Z2S1"><value>Erblasser</value></field>
      </fields>
      </xfdf>
      

      using FDFDocument.loadXFDF(new File("ttt.xfdf"));

      I get the following exception:

      java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredTextImpl cannot be cast to org.w3c.dom.Element
      	at org.apache.pdfbox.pdmodel.fdf.FDFDictionary.<init>(FDFDictionary.java:105)
      	at org.apache.pdfbox.pdmodel.fdf.FDFCatalog.<init>(FDFCatalog.java:68)
      	at org.apache.pdfbox.pdmodel.fdf.FDFDocument.<init>(FDFDocument.java:101)
      	at org.apache.pdfbox.pdmodel.fdf.FDFDocument.loadXFDF(FDFDocument.java:251)
      	at org.apache.pdfbox.pdmodel.fdf.FDFDocument.loadXFDF(FDFDocument.java:236)
          ...
      

      Attachments

        Activity

          People

            lehmi Andreas Lehmkühler
            tkrammer Thomas Krammer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: