ICEpdf
  1. ICEpdf
  2. PDF-1029

ClassCastException - HashMap cannot be cast to OptionalContents

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.2
    • Fix Version/s: 6.1.3
    • Component/s: Core/Rendering
    • Labels:
      None
    • Environment:
      All

      Description

      The following error strack trace is thrown when rendering the provided PDF file. This looks to be preventing the header and footer sections/images from rendering on the first page.

      WARNING: Error parsing content stream.
      java.lang.ClassCastException: java.util.HashMap cannot be cast to org.icepdf.core.pobjects.OptionalContents
      at org.icepdf.core.pobjects.Resources.getPropertyEntry(Resources.java:366)
      at org.icepdf.core.util.content.AbstractContentParser.consume_BDC(AbstractContentParser.java:1122)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Form.init(Form.java:196)
      at org.icepdf.core.util.content.AbstractContentParser.consume_Do(AbstractContentParser.java:556)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Page.init(Page.java:404)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1180)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

        Activity

        Hide
        Patrick Corless added a comment -

        Looks like a one off document that has some none standard syntax. The object that is returned is an empty hashmap instead of a proper OptionalContents structure. Once the type is checked and ignored the document renders correctly.

        Show
        Patrick Corless added a comment - Looks like a one off document that has some none standard syntax. The object that is returned is an empty hashmap instead of a proper OptionalContents structure. Once the type is checked and ignored the document renders correctly.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: