2 Replies Latest reply on Jan 20, 2012 3:37 AM by Eric K.

    Problem => javax.faces.component.StateHolderSaver cannot be cast to [Ljava.lang.Object;

    Andrija Ilic Newbie

      I'am relativly new to RichFaces and iam stuck at this mystery problem.

      I'am using rich:dataTable and data table filtering like on http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=dataTable&sample=tableFiltering&skin=blueSky . I made my code similar to this example but something is wrong...

      when i go to page with this code its ok, everything renders and works fine, then i jump to another non ajax/richfaces page and then jump back and got this error:

       

      WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception

      java.lang.ClassCastException: javax.faces.component.StateHolderSaver cannot be cast to [Ljava.lang.Object;

                at org.ajax4jsf.component.behavior.AjaxBehavior.restoreState(AjaxBehavior.java:343)

                at javax.faces.component.UIComponentBase.restoreBehaviors(UIComponentBase.java:2184)

                at javax.faces.component.UIComponentBase.restoreBehaviorsState(UIComponentBase.java:2151)

                at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1571)

                at javax.faces.component.UIOutput.restoreState(UIOutput.java:256)

                at javax.faces.component.UIInput.restoreState(UIInput.java:1404)

                at com.sun.faces.application.view.StateManagementStrategyImpl$2.visit(StateManagementStrategyImpl.java:253)

                at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)

                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1589)

                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)

                at org.richfaces.component.UIDataAdaptor.visitComponents(UIDataAdaptor.java:1172)

                at org.richfaces.component.UIDataAdaptor.visitFixedChildren(UIDataAdaptor.java:1182)

                at org.richfaces.component.UIDataTableBase.visitFixedChildren(UIDataTableBase.java:332)

                at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1248)

                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)

                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)

                at javax.faces.component.UIForm.visitTree(UIForm.java:344)

                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)

                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)

                at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:240)

                at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)

                at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)

                at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:452)

                at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)

                at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)

                at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)

                at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:189)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:113)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)

                at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

                at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

                at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

                at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)

                at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)

                at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)

                at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)

                at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)

                at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

                at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

                at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

                at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

                at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

                at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

                at java.lang.Thread.run(Thread.java:619)

       

      I'am using NetBeans 7 ide, GlassFish 3.1 server and all libs needed for richFaces 4. Also i use JSF 2.1.1 .. I dont know is something else important.

      I have searched for this error for some time and found similar problems but all of them was solved in reports and almost all of them was related on older versions then mine...

       

      Iam sorry if this topic is already is disscused somewhere else but i was unable to locate it. I also registrated couse i am after all unable to find workaround for my problem.

      When i use :

      <context-param>

              <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>

              <param-value>true</param-value>

      </context-param>

      then there is no error, but i loose other functionalities on other pages so this is not a solution 4 me... plz help :S