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

Jay Meyer commented on PDFBOX-1407:
-----------------------------------

IMHO, this is not a usage issue.  I think this Jira issue should describe the 
root cause and a workaround.  This issue was simply closed with "Not a 
Problem", when I do indeed have this problem.  The documentation for PDFBox 
does not describe the loadNonSeq() method at all - and the Javadoc does not 
describe why a caller would choose to use loadNonSeq() vs. load().

Ideally, the load() method would have a default behavior to prevent the 
ClassCastException from being thrown outside the library.  

This Jira issue matched my search perfectly - others may have this issue, and I 
recommend the resolution should be described in this Jira issue in detail.- or 
in the docs/Javadocs in a future version.
                
> ClassCastException: COSObject cannot be cast to COSName
> -------------------------------------------------------
>
>                 Key: PDFBOX-1407
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1407
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 1.7.0
>            Reporter: Lau Brino
>            Assignee: Andreas Lehmkühler
>
> Parsing PDF file
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSObject cannot be cast 
> to org.apache.pdfbox.cos.COSName
>         at 
> org.apache.pdfbox.cos.COSDocument.getObjectsByType(COSDocument.java:264)
>         at 
> org.apache.pdfbox.cos.COSDocument.dereferenceObjectStreams(COSDocument.java:571)
>         at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:225)
>         at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1090)
>         at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1055)
>         at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:110)
>         at 
> org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
>         at 
> org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to