ajax4jsf
  1. ajax4jsf
  2. AJAX4JSF-33

java.lang.ClassCastException: org.ajax4jsf.ajax.UIAjaxSupport$State when using Seam

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      33

      Description

      Using seam version 1.0.1GA in Jboss version 4.0.5GA got an ClassCastException
      error, with last version (1.0.5) of Ajax4jsf. The stacktrace:
      java.lang.ClassCastException: org.ajax4jsf.ajax.UIAjaxSupport$State
      at org.ajax4jsf.ajax.UIAjaxSupport.restoreState(UIAjaxSupport.java:401)
      at org.ajax4jsf.ajax.html.HtmlAjaxSupport.restoreState(HtmlAjaxSupport.java:493)
      at
      javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:728)
      at
      javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:700)
      at
      javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719)
      at
      javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719)
      at
      com.sun.faces.application.StateManagerImpl.restoreComponentState(StateManagerImpl.java:352)
      at
      com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:240)
      at
      org.ajax4jsf.framework.ajax.AjaxStateManager.restoreView(AjaxStateManager.java:76)
      at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:41)
      at
      org.ajax4jsf.framework.ajax.AjaxStateManager.restoreView(AjaxStateManager.java:76)
      at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:228)
      at
      org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:109)
      at
      org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:140)
      at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:64)
      at
      org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:109)
      at
      org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:140)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:157)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at
      org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at
      org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at
      org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at
      org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at
      org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Unknown Source)

      This error occur in "echo" application from "Ajax4jsf Developer Guide".
      Here the configurations:
      (faces-config.xml)
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE faces-config
      PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
      <faces-config>

      <!-- Phase listener needed for all Seam applications -->

      <lifecycle>
      <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
      </lifecycle>

      <!-- i18n -->

      <application>
      <locale-config>
      <default-locale>pt_BR</default-locale>
      <supported-locale>pt_BR</supported-locale>
      <supported-locale>en</supported-locale>
      </locale-config>
      </application>

      <navigation-rule>
      <navigation-case>
      <from-outcome>incluirLugar</from-outcome>
      <to-view-id>/incluirLugar.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>

      <navigation-rule>
      <navigation-case>
      <from-outcome>incluirVotacao</from-outcome>
      <to-view-id>/incluirVotacao.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>

      <navigation-rule>
      <navigation-case>
      <from-outcome>votar</from-outcome>
      <to-view-id>/votar.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>

      </faces-config>

      (web.xml)
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

      <!-- Seam -->
      <listener>
      <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
      </listener>

      <!-- Sun Jsf -->
      <listener>
      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
      </listener>

      <!-- Propagate conversations across redirects -->
      <filter>
      <filter-name>Seam Redirect Filter</filter-name>
      <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
      </filter>

      <!-- ajax4jsf -->
      <filter>
      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>

      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <url-pattern>*.seam</url-pattern>
      </filter-mapping>

      <filter-mapping>
      <filter-name>Seam Redirect Filter</filter-name>
      <url-pattern>*.seam</url-pattern>
      </filter-mapping>

      <filter>
      <filter-name>Seam Exception Filter</filter-name>
      <filter-class>
      org.jboss.seam.servlet.SeamExceptionFilter
      </filter-class>
      </filter>

      <filter-mapping>
      <filter-name>Seam Exception Filter</filter-name>
      <url-pattern>*.jsf</url-pattern>
      </filter-mapping>

      <!-- JSF -->
      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
      </context-param>

      <context-param>
      <param-name>com.sun.faces.validateXml</param-name>
      <param-value>true</param-value>
      </context-param>

      <context-param>
      <param-name>com.sun.faces.verifyObjects</param-name>
      <param-value>true</param-value>
      </context-param>

      <context-param>
      <param-name>org.ajax4jsf.SKIN</param-name>
      <param-value>DEFAULT</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.CONFIG_FILES</param-name>
      <param-value>/WEB-INF/faces-config.xml</param-value>
      </context-param>

      <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>

      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.seam</url-pattern>
      </servlet-mapping>

      </web-app>

        Activity

          People

          • Assignee:
            sergeysmirnov
            Reporter:
            valtoni
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: