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 2023/08/30 03:25:00 UTC

[jira] [Closed] (PDFBOX-5431) New NPE in xmpbox parser in trunk

     [ https://issues.apache.org/jira/browse/PDFBOX-5431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr closed PDFBOX-5431.
-----------------------------------
    Resolution: Duplicate

Fixed in PDFBOX-5649 which is a true duplicate, I "rediscovered" this file when I ran tika regression tests on PDFBox 3.0. Oops.

> New NPE in xmpbox parser in trunk
> ---------------------------------
>
>                 Key: PDFBOX-5431
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5431
>             Project: PDFBox
>          Issue Type: Task
>          Components: XmpBox
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Tim Allison
>            Priority: Major
>         Attachments: metadata.xml
>
>
> 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.
> {noformat}
>         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);
>                 }
>             }
>         }
> {noformat}
> Stack
> {noformat}
> 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)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org