[ 
https://issues.apache.org/jira/browse/PDFBOX-6381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18155687#comment-18155687
 ] 

Tilman Hausherr commented on PDFBOX-6381:
-----------------------------------------

This is much bigger than expected:
- the reduced file I created for PDFBOX-5835 shouldn't have parsed successfully 
(xmp validator fails)
- the original file from PDFBOX-5835 could have been used. While the zugferd 
specification is copyrighted, the Schemata are apache licensed 
https://www.ferd-net.de/en/ueber-uns/ressourcen-1/veroeffentlichungen/disclaimer-and-rights-of-use-zugferd
- saving the original file (which is valid) after reading it produces an 
invalid file

> NPE in XmpSerializer.serializeFields()
> --------------------------------------
>
>                 Key: PDFBOX-6381
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6381
>             Project: PDFBox
>          Issue Type: Sub-task
>          Components: XmpBox
>    Affects Versions: 2.0.37, 3.0.8 PDFBox
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.38, 3.0.9 PDFBox, 4.0.0
>
>
> {noformat}
> java.lang.NullPointerException
>       at 
> org.apache.xmpbox.xml.XmpSerializer.serializeFields(XmpSerializer.java:163)
>       at 
> org.apache.xmpbox.xml.XmpSerializer.serializeFields(XmpSerializer.java:205)
>       at 
> org.apache.xmpbox.xml.XmpSerializer.serializeFields(XmpSerializer.java:183)
>       at 
> org.apache.xmpbox.xml.XmpSerializer.serializeSchema(XmpSerializer.java:114)
>       at org.apache.xmpbox.xml.XmpSerializer.serialize(XmpSerializer.java:98)
>       at 
> org.apache.xmpbox.xml.DomXmpParserTest.testPDFBox5835(DomXmpParserTest.java:93)
> {noformat}
> This happens by serializing the input read in testPDFBox5835:
> {code:java}
>             XmpSerializer serializer = new XmpSerializer();
>             ByteArrayOutputStream baos = new ByteArrayOutputStream();
>             serializer.serialize(xmp, baos, true);
> {code}
> Avoiding the NPE isn't enough, because this is the output:
> {code:xml}
>       <null:schemas>
>         <rdf:Bag>
>           <rdf:li rdf:parseType="Resource">
>             <null:schema>Some Schema</null:schema>
>           </rdf:li>
>         </rdf:Bag>
>       </null:schemas>
> {code}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to