java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Confluence is throwing this error message in the logs: {code} 2015-06-11 08:24:18,444 WARN [Indexer: 4] [apache.pdfbox.cos.COSDocument] getObjectsByType java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSName - referer: http://URL/admin/search-indexes.action | url: /admin/reindex.action | userName:user | action: reindex java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSName at org.apache.pdfbox.cos.COSDocument.getObjectsByType(COSDocument.java:294) at org.apache.pdfbox.cos.COSDocument.dereferenceObjectStreams(COSDocument.java:656) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:244) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1219) at com.atlassian.bonnie.search.extractor.PdfContentExtractor.extractText(PdfContentExtractor.java:59) at com.atlassian.bonnie.search.extractor.BaseAttachmentContentExtractor.addFields(BaseAttachmentContentExtractor.java:41) {code} and It seems to be throwing an out of memory for the indexer due to this bug as well: {code} - referer: http://URL/admin/search-indexes.action | url: /admin/reindex.action | userName: user | action: reindex java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.io.ByteArrayOutputStream.grow(Unknown Source) at java.io.ByteArrayOutputStream.ensureCapacity(Unknown Source) at java.io.ByteArrayOutputStream.write(Unknown Source) at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:172) at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:98) at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:308) at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248) at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183) at org.apache.pdfbox.pdfparser.PDFStreamParser.<init>(PDFStreamParser.java:107) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235) at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215) at org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:456) at org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:381) at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:340) {code} This is caused by a bug in the PDFBOX stated here: https://issues.apache.org/jira/browse/PDFBOX-1756 Confluence 5.7.3, 5.8.2 and 5.8.4 ships the version 1.8.4 of pdfbox, which is affected by the bug. h3. Workaround 1) Disable the indexing of PDF attachments using [this guide|https://confluence.atlassian.com/x/gYCIAw] OR 2) Update the pdfbox plugin manually in Confluence_install\confluence\WEB-INF\lib folder by replacing the original pdf plugin with a version [1.8.6|http://archive.apache.org/dist/pdfbox/1.8.6/pdfbox-1.8.6.jar] or newer. Download the newer version [here|http://archive.apache.org/dist/pdfbox/]
    via by Rodrigo Girardi Adami [Atlassian],
  • Confluence is throwing this error message in the logs: {code} 2015-06-11 08:24:18,444 WARN [Indexer: 4] [apache.pdfbox.cos.COSDocument] getObjectsByType java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSName - referer: http://URL/admin/search-indexes.action | url: /admin/reindex.action | userName:user | action: reindex java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSName at org.apache.pdfbox.cos.COSDocument.getObjectsByType(COSDocument.java:294) at org.apache.pdfbox.cos.COSDocument.dereferenceObjectStreams(COSDocument.java:656) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:244) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1219) at com.atlassian.bonnie.search.extractor.PdfContentExtractor.extractText(PdfContentExtractor.java:59) at com.atlassian.bonnie.search.extractor.BaseAttachmentContentExtractor.addFields(BaseAttachmentContentExtractor.java:41) {code} and It seems to be throwing an out of memory for the indexer due to this bug as well: {code} - referer: http://URL/admin/search-indexes.action | url: /admin/reindex.action | userName: user | action: reindex java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.io.ByteArrayOutputStream.grow(Unknown Source) at java.io.ByteArrayOutputStream.ensureCapacity(Unknown Source) at java.io.ByteArrayOutputStream.write(Unknown Source) at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:172) at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:98) at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:308) at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248) at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183) at org.apache.pdfbox.pdfparser.PDFStreamParser.<init>(PDFStreamParser.java:107) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235) at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215) at org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:456) at org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:381) at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:340) {code} This is caused by a bug in the PDFBOX stated here: https://issues.apache.org/jira/browse/PDFBOX-1756 Confluence 5.7.3, 5.8.2 and 5.8.4 ships the version 1.8.4 of pdfbox, which is affected by the bug. h3. Workaround 1) Disable the indexing of PDF attachments using [this guide|https://confluence.atlassian.com/x/gYCIAw] OR 2) Update the pdfbox plugin manually in Confluence_install\confluence\WEB-INF\lib folder by replacing the original pdf plugin with a version [1.8.6|http://archive.apache.org/dist/pdfbox/1.8.6/pdfbox-1.8.6.jar] or newer. Download the newer version [here|http://archive.apache.org/dist/pdfbox/]
    via by Rodrigo Girardi Adami [Atlassian],
    • java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSName at org.apache.pdfbox.cos.COSDocument.getObjectsByType(COSDocument.java:294) at org.apache.pdfbox.cos.COSDocument.dereferenceObjectStreams(COSDocument.java:656) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:244) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1219) at com.atlassian.bonnie.search.extractor.PdfContentExtractor.extractText(PdfContentExtractor.java:59) at com.atlassian.bonnie.search.extractor.BaseAttachmentContentExtractor.addFields(BaseAttachmentContentExtractor.java:41)
    No Bugmate found.