ICEfaces
  1. ICEfaces
  2. ICE-5595

ICEfaces 2.0 BridgeSetup StateManagerStrategyImpl ClassCastException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Alpha3, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2.0

      Description


      The following exception appears immediately on postback from a clean checkout and build of auction:

      java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.util.Map
      at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:212)
      at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
      at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
      at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:199)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:619)

      It appears to be due to state management side effects in BridgeSetup.java.

        Activity

        Ted Goddard created issue -
        Ted Goddard made changes -
        Field Original Value New Value
        Assignee Mircea Toma [ mircea.toma ]
        Hide
        Mircea Toma added a comment - - edited

        It seems that state saved when BridgeSetup invokes StateManager.getViewState is of different type than the one expected when restore phase is executed, hence the ClassCastException.
        The exact place where state saving type is configured is here:
        com.sun.faces.application.view.FaceletViewHandlingStrategy.updateStateSavingType(FaceletViewHandlingStrategy.java:1,020)
        at
        com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:699)
        at
        com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)

        FaceletViewHandlingStrategy.updateStateSavingType will set the the attribute "partialStateSaving" to true after BridgeSetup invokes StateManager.getViewState. Subsequent restore phase executions will expect the state save in the format corresponding to partial state saving strategy.

        Show
        Mircea Toma added a comment - - edited It seems that state saved when BridgeSetup invokes StateManager.getViewState is of different type than the one expected when restore phase is executed, hence the ClassCastException. The exact place where state saving type is configured is here: com.sun.faces.application.view.FaceletViewHandlingStrategy.updateStateSavingType(FaceletViewHandlingStrategy.java:1,020) at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:699) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) FaceletViewHandlingStrategy.updateStateSavingType will set the the attribute "partialStateSaving" to true after BridgeSetup invokes StateManager.getViewState. Subsequent restore phase executions will expect the state save in the format corresponding to partial state saving strategy.
        Hide
        Mircea Toma added a comment -

        Moving the BridgeSetup code from a phase listener into a system event listener that listens for PreRenderViewEvent event seems to solve the issue since PreRenderViewEvent is fired after partial state saving is configured as state saving strategy.

        Show
        Mircea Toma added a comment - Moving the BridgeSetup code from a phase listener into a system event listener that listens for PreRenderViewEvent event seems to solve the issue since PreRenderViewEvent is fired after partial state saving is configured as state saving strategy.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21176 Wed Apr 07 17:16:37 MDT 2010 deryk.sinotte ICE-5595: changed BridgeSetup into a system event listener
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/resources/META-INF/faces-config.xml
        Commit graph ADD /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/event/WindowScopeSetup.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/event/BridgeSetup.java
        Hide
        Mircea Toma added a comment - - edited

        Changed BridgeSetup into a system event listener to avoid invoking StateManager.getViewState before state management strategy is chosen by JSF.

        Show
        Mircea Toma added a comment - - edited Changed BridgeSetup into a system event listener to avoid invoking StateManager.getViewState before state management strategy is chosen by JSF.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.0-Alpha3 [ 10032 ]
        Ken Fyten made changes -
        Fix Version/s 2.0.0 [ 10230 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: