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

Tilman Hausherr edited comment on PDFBOX-5649 at 8/27/23 3:06 PM:
------------------------------------------------------------------

I've been playing with the Babin file for some time today, here some findings 
about the code:
- The problem happens because {{PropertyType ctype = 
checkPropertyDefinition(xmp, DomHelper.getQName(first))}} is null
- This is because in TypeMapping.java, 
{{factory.getPropertyType(name.getLocalPart())}} returns null on "Schema"
- This is because in XMPSchemaFactory.java, the initialization is done with an 
empty {{propDef}}
- This happens in DomXmpParser.java when {{tm.addNewNameSpace(namespace, 
prefix)}} is called
- The Schema isn't an "unknown" schema, it exists in the class 
PDFASchemaType.java and has {{PropertyType}} annotations, but the class isn't 
extended from the XMPSchema class, it's an AbstractStructuredType, so that 
schema can't be included in the initialization in {{TypeMapping.initialize()}}
- At the time {{addNewNameSpace}} is called, the software doesn't "know" about 
the class, it has only two strings

That's all for today :-(


was (Author: tilman):
I've been playing with the Babin file for some time today, here some findings 
about the code:
- The problem happens because {{PropertyType ctype = 
checkPropertyDefinition(xmp, DomHelper.getQName(first))}} is null
- This is because in TypeMapping.java, 
{{factory.getPropertyType(name.getLocalPart())}} returns null on "Schema"
- This is because in XMPSchemaFactory.java, the initialization is done with an 
empty {{propDef}}
- This happens in DomXmpParser.java when {{tm.addNewNameSpace(namespace, 
prefix)}} is called
- The Schema isn't an "unknown" schema, it exists in the class 
PDFASchemaType.java and has {{PropertyType}} annotations, but the class isn't 
extended from the XMPSchema class, it's an AbstractStructuredType.
- At the time {{addNewNameSpace}} is called, the software doesn't "know" about 
the class, it has only two strings

That's all for today :-(

> NPE in DomXmpParser.parseLiDescription
> --------------------------------------
>
>                 Key: PDFBOX-5649
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5649
>             Project: PDFBox
>          Issue Type: Bug
>          Components: XmpBox
>    Affects Versions: 2.0.29, 3.0.0 PDFBox
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Minor
>              Labels: regression
>         Attachments: metadata.xml, pdfExemple.pdf
>
>
> org.apache.xmpbox.xml.XmpParsingException: ctype is null, first: 
> [stEvt:action: null], DomHelper.getQName(first): 
> {http://ns.adobe.com/xap/1.0/sType/ResourceEvent#}action
>       at 
> org.apache.xmpbox.xml.DomXmpParser.parseLiDescription(DomXmpParser.java:611)
>       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.xmp.XMPMetadataExtractor.parse(XMPMetadataExtractor.java:57)
> I'll throw a parsing exception for now. It happens with the file 
> testIndesign.idml of the Tika project.



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

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

Reply via email to