java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.HashMap

Icesoft | nam.ht | 2 years ago
  1. 0

    PdfViewer got exception when open a specific PDF file

    Icesoft | 2 years ago | nam.ht
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.HashMap
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    When rendering the provided PDF file, the following error stack traces are thrown: Mar 29, 2016 9:36:20 AM org.icepdf.core.util.content.NContentParser parse FINE: Parsing page content streams: 1 Mar 29, 2016 9:36:20 AM org.icepdf.core.util.content.NContentParser parse FINER: Content = .~øC ç1 Mar 29, 2016 9:36:20 AM org.icepdf.core.util.content.NContentParser parse WARNING: Error parsing content stream. java.lang.ClassCastException: java.lang.Float cannot be cast to org.icepdf.core.pobjects.Name at org.icepdf.core.util.content.AbstractContentParser.consume_CS(AbstractContentParser.java:244) at org.icepdf.core.util.content.NContentParser.parse(Unknown Source) at org.icepdf.core.pobjects.graphics.TilingPattern.init(TilingPattern.java:296) at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1840) at org.icepdf.core.util.content.AbstractContentParser.consume_f_star(AbstractContentParser.java:1180) at org.icepdf.core.util.content.NContentParser.parse(Unknown Source) at org.icepdf.core.pobjects.Page.init(Page.java:403) at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1169) 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) Mar 29, 2016 9:36:20 AM org.icepdf.core.util.content.NContentParser parse FINE: Parsing page content streams: 1 Mar 29, 2016 9:36:20 AM org.icepdf.core.util.content.NContentParser parse FINER: Content = kÛ÷ßwV° Mar 29, 2016 9:36:20 AM org.icepdf.core.util.content.NContentParser parse WARNING: Error parsing content stream. java.util.EmptyStackException at java.util.Stack.peek(Stack.java:102) at java.util.Stack.pop(Stack.java:84) at org.icepdf.core.util.content.AbstractContentParser.consume_k(AbstractContentParser.java:230) at org.icepdf.core.util.content.NContentParser.parse(Unknown Source) at org.icepdf.core.pobjects.graphics.TilingPattern.init(TilingPattern.java:296) at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1840) at org.icepdf.core.util.content.AbstractContentParser.consume_f_star(AbstractContentParser.java:1180) at org.icepdf.core.util.content.NContentParser.parse(Unknown Source) at org.icepdf.core.pobjects.Page.init(Page.java:403) at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1169) 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) The customer is also reporting that these exceptions result in an endless loop.

    ICEsoft JIRA Issue Tracker | 8 months ago | Arran Mccullough
    java.lang.ClassCastException: java.lang.Float cannot be cast to org.icepdf.core.pobjects.Name

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.util.ArrayList cannot be cast to java.util.HashMap

      at org.icepdf.core.util.Parser.getObject()
    2. org.icepdf.core
      Page.init
      1. org.icepdf.core.util.Parser.getObject(Parser.java:187)
      2. org.icepdf.core.util.LazyObjectLoader.loadObject(LazyObjectLoader.java:73)
      3. org.icepdf.core.util.Library.getObject(Library.java:156)
      4. org.icepdf.core.util.Library.getObject(Library.java:206)
      5. org.icepdf.core.pobjects.fonts.FontDescriptor.init(FontDescriptor.java:294)
      6. org.icepdf.core.pobjects.fonts.ofont.Font.init(Font.java:326)
      7. org.icepdf.core.pobjects.fonts.ofont.Font.init(Font.java:372)
      8. org.icepdf.core.pobjects.Resources.getFont(Resources.java:150)
      9. org.icepdf.core.util.content.AbstractContentParser.consume_Tf(AbstractContentParser.java:747)
      10. org.icepdf.core.util.content.OContentParser.parseText(OContentParser.java:795)
      11. org.icepdf.core.util.content.OContentParser.parse(OContentParser.java:180)
      12. org.icepdf.core.pobjects.Page.init(Page.java:370)
      12 frames
    3. org.icepdf.ri
      PageViewComponentImpl$PageInitializer.run
      1. org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1065)
      1 frame
    4. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      3. java.lang.Thread.run(Unknown Source)
      3 frames