ICEfaces
  1. ICEfaces
  2. ICE-6269

ClassCastException When Navigating to Page with an ace:fileEntry Component

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Affects:
      Compatibility/Configuration
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
           <context-param>
              <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
              <param-value>false</param-value>
          </context-param>
      Show
           <context-param>         <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>         <param-value>false</param-value>     </context-param>

      Description

      Class Cast Exception when navigating/displaying a page with the ace:fileEntry component on the page. Exception Stack Trace:

      SEVERE: javax.faces.FacesException: Unexpected error restoring state for component with id javax_faces_location_HEAD. Cause: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;.
              at com.sun.faces.application.view.StateManagementStrategyImpl$2.visit(StateManagementStrategyImpl.java:239)
              at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:147)
              at javax.faces.component.UIComponent.visitTree(UIComponent.java:1446)
              at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
              at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:223)
              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.StandardWrapper.service(StandardWrapper.java:1523)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
              at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
              at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
              at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
              at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
              at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
              at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
              at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
              at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
              at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
              at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
              at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
              at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
              at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
              at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;
              at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1421)
              at com.sun.faces.application.view.StateManagementStrategyImpl$2.visit(StateManagementStrategyImpl.java:231)
              ... 37 more

        Activity

        Hide
        Ted Goddard added a comment -

        Test with JSF 2.1 before closing.

        Show
        Ted Goddard added a comment - Test with JSF 2.1 before closing.
        Hide
        Ted Goddard added a comment -

        Tested with Mojarra 2.1.0 (SNAPSHOT 20100903) and issue is still present. This may be fixed in a more recent version of JSF 2.1, but javaserverfaces.dev.java.net is still offline.

        If an application is using ACE and components are dynamically added or removed from the page due to Facelet processing, Partial State Saving must be disabled:

        <context-param>
        <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
        <param-value>false</param-value>
        </context-param>

        Show
        Ted Goddard added a comment - Tested with Mojarra 2.1.0 (SNAPSHOT 20100903) and issue is still present. This may be fixed in a more recent version of JSF 2.1, but javaserverfaces.dev.java.net is still offline. If an application is using ACE and components are dynamically added or removed from the page due to Facelet processing, Partial State Saving must be disabled: <context-param> <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name> <param-value>false</param-value> </context-param>
        Hide
        Ted Goddard added a comment -

        Need to test with Dec 10 JSF 2.1.

        Show
        Ted Goddard added a comment - Need to test with Dec 10 JSF 2.1.
        Hide
        Ted Goddard added a comment -

        INFO: Initializing Mojarra 2.1.0 (SNAPSHOT b09) for context '/Case9552Example3'

        Able to switch between the dynamic include with no ClassCastException.

        Show
        Ted Goddard added a comment - INFO: Initializing Mojarra 2.1.0 (SNAPSHOT b09) for context '/Case9552Example3' Able to switch between the dynamic include with no ClassCastException.
        Hide
        Ted Goddard added a comment -

        This is fixed in an upcoming version of JSF 2.1.

        Show
        Ted Goddard added a comment - This is fixed in an upcoming version of JSF 2.1.

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: