[
https://issues.apache.org/jira/browse/PDFBOX-5431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17534493#comment-17534493
]
Tilman Hausherr commented on PDFBOX-5431:
-----------------------------------------
It's easy to avoid the NPE, but I wonder what exactly is wrong with the file?
(for the exception text)
> 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.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]