2 Replies Latest reply on Jun 20, 2007 9:18 AM by Juan Ignacio Sánchez Lara

    ClassCastException: java.lang.String at restoreState

    Juan Ignacio Sánchez Lara Apprentice

      I use Ajax4JSF (1.1.1), RichFaces (3.0.1), Facelets (1.1.12) and MyFaces (1.1.15), and my requests sometimes throws this exception:

      [#|2007-06-19T20:12:07.844+0200|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.system.container.web|_ThreadID=15;|StandardWrapperValve[Faces Servlet]: Servlet.service() para el servlet Faces Servlet desencadenó una excepción
      java.lang.ClassCastException: java.lang.String
       at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:947)
       at org.ajax4jsf.ajax.html.AjaxLoadBundle.restoreState(AjaxLoadBundle.java:126)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:731)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
       at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
       at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreComponentState(JspStateManagerImpl.java:200)
       at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:270)
       at org.ajax4jsf.framework.ajax.AjaxStateManager.restoreView(AjaxStateManager.java:83)
       at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:231)
       at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:310)
       at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:150)
       at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81)
       at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
       at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
       at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
       at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
       at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:190)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
       at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:126)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:248)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
       at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at es.jcyl.ita.fwk2.web.ITAFiltro.doFilter(ITAFiltro.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
       at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:183)
       at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
       at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
       at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
       at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:188)
       at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
       at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
       at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
       at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
      |#]


      If I set a breakpoint at that position it shows state is not an Object[] but a String containing an id. I haven't been able yet to find out which page component is the problematic one, because not only ajaxBundle restore crashes, but also others (like t:dojoInitializer).

      Any ideas?