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

Tilman Hausherr commented on PDFBOX-4325:
-----------------------------------------

This partly fixed the bug, or at least avoids the CCE for your case. However 
now you get a false negative:
{noformat}
7.3 : Error on MetaData, Cannot find a definition for the namespace 
http://www.aiim.org/pdfua/ns/id/{noformat}
This is not true. the file is PDF/A. The problem is that xmpbox can't work with 
new Schemas. I don't know how to fix that, and I don't know if this will be 
fixed soon. In the meantime please use VeraPDF https://github.com/verapdf .

> Validation fails with ClassCastException
> ----------------------------------------
>
>                 Key: PDFBOX-4325
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4325
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Preflight
>    Affects Versions: 2.0.11
>            Reporter: Alonso Gonzalez
>            Priority: Major
>         Attachments: CreatePdf.java, pdfa1b-itext.pdf
>
>
> We have to validate PDFs that were created using iText5. But the validation 
> fails with a ClassCastException:
> {noformat}
> Exception in thread "main" java.lang.ClassCastException: class 
> org.apache.xmpbox.type.PDFAPropertyType
>       at java.lang.Class.asSubclass(Class.java:3404)
>       at 
> org.apache.xmpbox.type.TypeMapping.instanciateSimpleProperty(TypeMapping.java:180)
>       at 
> org.apache.xmpbox.xml.DomXmpParser.parseLiElement(DomXmpParser.java:521)
>       at 
> org.apache.xmpbox.xml.DomXmpParser.parseLiDescription(DomXmpParser.java:603)
>       at 
> org.apache.xmpbox.xml.DomXmpParser.parseLiElement(DomXmpParser.java:514)
>       at org.apache.xmpbox.xml.DomXmpParser.manageArray(DomXmpParser.java:465)
>       at 
> org.apache.xmpbox.xml.DomXmpParser.createProperty(DomXmpParser.java:344)
>       at 
> org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(DomXmpParser.java:311)
>       at 
> org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(DomXmpParser.java:240)
>       at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:192)
>       at 
> org.apache.pdfbox.preflight.process.MetadataValidationProcess.validate(MetadataValidationProcess.java:69)
>       at 
> org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:84)
>       at 
> org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:122)
>       at 
> org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:166)
>       at Main.main(Main.java:40)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
> {noformat}
> I've attached a minimal example PDF that triggers the error.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to