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 2025/11/29 14:55:00 UTC

[jira] [Resolved] (PDFBOX-6111) ClassCastException in XMPMediaManagementSchema.getHistory()

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

Tilman Hausherr resolved PDFBOX-6111.
-------------------------------------
    Resolution: Fixed

> ClassCastException in XMPMediaManagementSchema.getHistory()
> -----------------------------------------------------------
>
>                 Key: PDFBOX-6111
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6111
>             Project: PDFBox
>          Issue Type: Bug
>          Components: XmpBox
>    Affects Versions: 2.0.35, 3.0.6 PDFBox
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Minor
>             Fix For: 2.0.36, 3.0.7 PDFBox, 4.0.0
>
>
> This happens with the XMP of testPDFBox5288 if I add {{xmpMediaManagementSchema.getHistory()}}:
> {noformat}
> java.lang.ClassCastException: class org.apache.xmpbox.type.ResourceEventType cannot be cast to class org.apache.xmpbox.type.AbstractSimpleProperty (org.apache.xmpbox.type.ResourceEventType and org.apache.xmpbox.type.AbstractSimpleProperty are in unnamed module of loader 'app')
> 	at org.apache.xmpbox.type.ArrayProperty.lambda$getElementsAsString$0(ArrayProperty.java:76)
> 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
> 	at org.apache.xmpbox.type.ArrayProperty.getElementsAsString(ArrayProperty.java:76)
> 	at org.apache.xmpbox.schema.XMPSchema.getUnqualifiedSequenceValueList(XMPSchema.java:857)
> 	at org.apache.xmpbox.schema.XMPMediaManagementSchema.getHistory(XMPMediaManagementSchema.java:792)
> 	at org.apache.xmpbox.xml.DomXmpParserTest.testPDFBox5288(DomXmpParserTest.java:154){noformat}
> The reason is that this call expects a list of simple types but it is a list of ResourceEventType. I'll deprecate the method in 2.0 and 3.0 and remove it in the trunk.



--
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