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

New NPE in xmpbox parser in trunk

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.0.0 PDFBox
    • None
    • XmpBox
    • None

    Description

      I noticed a new NPE in one of our test files on Tika when I recently built PDFBox's trunk. I've attached the file.

      If I don't set strict parsing to false, the parse works.

              DomXmpParser xmpParser = new DomXmpParser();
              xmpParser.setStrictParsing(false);
              Path p = Paths.get(".../metadata.xml");
              try (InputStream is = Files.newInputStream(p)) {
                  XMPMetadata metadata = xmpParser.parse(is);
                  for (XMPSchema schema : metadata.getAllSchemas()) {
                      for (AbstractField f : schema.getAllProperties()) {
                          System.out.println(f);
                      }
                  }
              }
      

      Stack

      ava.lang.NullPointerException
      	at org.apache.xmpbox.xml.DomXmpParser.parseLiDescription(DomXmpParser.java:608)
      	at org.apache.xmpbox.xml.DomXmpParser.parseLiElement(DomXmpParser.java:529)
      	at org.apache.xmpbox.xml.DomXmpParser.manageArray(DomXmpParser.java:487)
      	at org.apache.xmpbox.xml.DomXmpParser.createProperty(DomXmpParser.java:352)
      	at org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(DomXmpParser.java:319)
      	at org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(DomXmpParser.java:248)
      	at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:201)
      	at org.apache.tika.parser.indesign.IDMLParserTest.testXMP(IDMLParserTest.java:81)
      

      Attachments

        1. metadata.xml
          2 kB
          Tim Allison

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tallison Tim Allison
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: