ICEpdf
  1. ICEpdf
  2. PDF-667

ClassCastException: org.icepdf.core.pobjects.graphics.ICCBased cannot be cast to java.util.HashMap

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.4
    • Fix Version/s: 5.0.5
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All
    • Salesforce Case Reference:

      Description

      The following error stack trace is thrown when trying to render the provided PDF file:

      WARNING: Error parsing content stream.
      java.lang.ClassCastException: org.icepdf.core.pobjects.graphics.ICCBased cannot be cast to java.util.HashMap
      at org.icepdf.core.pobjects.graphics.PColorSpace.getHashMap(PColorSpace.java:162)
      at org.icepdf.core.pobjects.graphics.PColorSpace.getColorSpace(PColorSpace.java:127)
      at org.icepdf.core.pobjects.Resources.getColorSpace(Resources.java:92)
      at org.icepdf.core.util.content.AbstractContentParser.consume_cs(AbstractContentParser.java:241)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Page.init(Page.java:370)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1064)
      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:722)

        Activity

        Arran Mccullough created issue -
        Hide
        Arran Mccullough added a comment -

        When testing the same file with the 5.0.3 release a different error is thrown but more content is rendered:

        WARNING: Error parsing content stream.
        java.lang.NullPointerException
        at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1779)
        at org.icepdf.core.util.content.AbstractContentParser.consume_f(AbstractContentParser.java:1035)
        at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
        at org.icepdf.core.pobjects.graphics.TilingPattern.init(TilingPattern.java:307)
        at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1774)
        at org.icepdf.core.util.content.AbstractContentParser.consume_f(AbstractContentParser.java:1035)
        at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
        at org.icepdf.core.pobjects.Page.init(Page.java:368)
        at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1039)
        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:722)

        Show
        Arran Mccullough added a comment - When testing the same file with the 5.0.3 release a different error is thrown but more content is rendered: WARNING: Error parsing content stream. java.lang.NullPointerException at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1779) at org.icepdf.core.util.content.AbstractContentParser.consume_f(AbstractContentParser.java:1035) at org.icepdf.core.util.content.NContentParser.parse(Unknown Source) at org.icepdf.core.pobjects.graphics.TilingPattern.init(TilingPattern.java:307) at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1774) at org.icepdf.core.util.content.AbstractContentParser.consume_f(AbstractContentParser.java:1035) at org.icepdf.core.util.content.NContentParser.parse(Unknown Source) at org.icepdf.core.pobjects.Page.init(Page.java:368) at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1039) 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:722)
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case Reference 5007000000WgQ9sAAF
        Arran Mccullough made changes -
        Salesforce Case Reference 5007000000WgQ9sAAF 5007000000Wh7pgAAB,5007000000WgQ9sAAF
        Arran Mccullough made changes -
        Salesforce Case Reference 5007000000Wh7pgAAB,5007000000WgQ9sAAF 5007000000MGUmRAAX,5007000000Wh7pgAAB,5007000000WgQ9sAAF
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #38655 Wed Oct 23 10:52:02 MDT 2013 patrick.corless PDF-667 updated how we parse the pattern colour space to avoid a class cast issue.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/util/content/AbstractContentParser.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/PColorSpace.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #38656 Wed Oct 23 10:52:15 MDT 2013 patrick.corless PDF-667 updated how we parse the pattern colour space to avoid a class cast issue.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/PColorSpace.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/content/AbstractContentParser.java
        Hide
        Patrick Corless added a comment -

        Update how we parse pattern colour spaces to avoid the class cast exception. The issue was related to how we store object in the library object cache vs how we load the objects from disk. Also addressed a null pointer issue for Pattern tiles that don't have a bounding box.

        Show
        Patrick Corless added a comment - Update how we parse pattern colour spaces to avoid the class cast exception. The issue was related to how we store object in the library object cache vs how we load the objects from disk. Also addressed a null pointer issue for Pattern tiles that don't have a bounding box.
        Patrick Corless made changes -
        Fix Version/s 5.0.5 [ 11373 ]
        Hide
        Patrick Corless added a comment -

        Code checked in on branch and trunk, marking as fixed.

        Show
        Patrick Corless added a comment - Code checked in on branch and trunk, marking as fixed.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: