6 Replies Latest reply on Dec 14, 2016 3:17 AM by manarh

    Illegal attempt to set StateManager after a response has been rendered.

    knjendu

      Hi guys,

      I'm attempting to upgrade our frameworks to Seam 2.3 Richfaces 4.3.3 and JSF 2.2 on Tomcat 6.0.29. Upon attempting to access the test page I get the following exception

      SEVERE: java.lang.IllegalStateException caught during beforePhase() processing of RESTORE_VIEW 1 : UIComponent-ClientId=, Message=Illegal attempt to set StateManager after a response has been rendered.

      Sep 7, 2013 6:54:32 PM javax.faces.webapp.PreJsf2ExceptionHandlerFactory$PreJsf2ExceptionHandler log

      SEVERE: Illegal attempt to set StateManager after a response has been rendered.

      java.lang.IllegalStateException: Illegal attempt to set StateManager after a response has been rendered.

        at com.sun.faces.application.ApplicationImpl.setStateManager(ApplicationImpl.java:646)

        at org.jboss.seam.jsf.SeamApplication.setStateManager(SeamApplication.java:377)

        at org.ajax4jsf.framework.ajax.InitPhaseListener.beforePhase(InitPhaseListener.java:78)

        at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)

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

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

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

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

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        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:235)

        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:293)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

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

       

      Here is my web.xml file



      <?xml version="1.0" encoding="ISO-8859-1"?>

      <web-app xmlns="http://java.sun.com/xml/ns/javaee"

               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"

               version="3.0">

          <display-name>jsfSandbox</display-name>

          <description>jsfSandbox</description>


          <!-- Seam -->

          <listener>

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

          </listener>

        

          <servlet>

              <servlet-name>Seam Resource Servlet</servlet-name>

              <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>

          </servlet>

        

          <servlet-mapping>

              <servlet-name>Seam Resource Servlet</servlet-name>

              <url-pattern>/seam/resource/*</url-pattern>

          </servlet-mapping>

        

          <filter>

              <filter-name>Seam Filter</filter-name>

              <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>

          </filter>

       

       

          <filter-mapping>

              <filter-name>Seam Filter</filter-name>

              <url-pattern>/*</url-pattern>

          </filter-mapping>

        

        

          <!-- FACELETS -->

           <context-param>

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

              <param-value>server</param-value>

          </context-param>

        

          <context-param>

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

              <param-value>.xhtml</param-value>

          </context-param>

       

          <context-param>

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

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

          </context-param>

       

         <context-param>

            <param-name>facelets.DEVELOPMENT</param-name>

            <param-value>true</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>

          <servlet-mapping>

              <servlet-name>Faces Servlet</servlet-name>

              <url-pattern>*.seam</url-pattern>

          </servlet-mapping>

          <!--<servlet-mapping>

              <servlet-name>Faces Servlet</servlet-name>

              <url-pattern>*.xhtml</url-pattern>

          </servlet-mapping>-->

       

          <!-- RichFaces filter -->

       

          <filter>

              <display-name>RichFaces Filter</display-name>

              <filter-name>richfaces</filter-name>

              <filter-class>org.ajax4jsf.Filter</filter-class>

        <init-param>

              <param-name>maxRequestSize</param-name>

              <param-value>10000000</param-value>

        </init-param>

          </filter>

       

          <filter-mapping>

              <filter-name>richfaces</filter-name>

              <servlet-name>Faces Servlet</servlet-name>

              <dispatcher>REQUEST</dispatcher>

              <dispatcher>FORWARD</dispatcher>

              <dispatcher>INCLUDE</dispatcher>

          </filter-mapping>

       

          <context-param>

              <param-name>org.richfaces.SKIN</param-name>

              <param-value>emeraldTown</param-value>

          </context-param>

       

          <session-config>

              <session-timeout>30</session-timeout>

          </session-config>

       

          <welcome-file-list>

              <welcome-file>home.xhtml</welcome-file>

          </welcome-file-list>

       

      </web-app>

       

      Here is my faces-config.xml


      <?xml version="1.0" encoding="UTF-8"?>

      <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"

          version="2.2">

       

      </faces-config>

       

      And finally here is the test page home.xhtml


      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"

          xmlns:s="http://jboss.com/products/seam/taglib"

          xmlns:ui="http://xmlns.jcp.org/jsf/facelets"

          xmlns:f="http://xmlns.jcp.org/jsf/core"

          xmlns:h="http://xmlns.jcp.org/jsf/html"

          xmlns:a4j="http://richfaces.org/a4j"

          xmlns:rich="http://richfaces.org/rich">

       

       

      <f:view contentType="text/html">

        <head>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

        <title>JSF Sandbox</title>

        </head>

        <body id="simple">

        <h:form id="testForm">

        <a4j:log />

        Welcome to JSF 2.2

        </h:form>

        </body>

      </f:view>

      </html>

       

      Here is a listing of all the libraries in my WEB-INF/lib folder

       

      ajax4jsf-1.0.6.jar

      antlr-3.4-complete.jar

      c3p0-0.9.1.2.jar

      commons-beanutils.jar

      commons-codec-1.5.jar

      commons-codec.jar

      commons-collections.jar

      commons-digester.jar

      commons-el-1.0.jar

      commons-fileupload-1.2.1.jar

      commons-httpclient-3.1.jar

      commons-io-1.3.2.jar

      commons-io.jar

      commons-jexl-2.1.1.jar

      commons-lang.jar

      commons-logging-1.1.1.jar

      commons-logging.jar

      concurrent.jar

      dom4j.jar

      ehcache-core-2.4.3.jar

      ehcache.jar

      fontbox.jar

      geronimo-validation_1.0_spec-1.0-CR5 (1).jar

      guava-r09.jar

      hibernate-c3p0-4.2.5.Final.jar

      hibernate-commons-annotations-4.0.2.Final.jar

      hibernate-core-4.2.5.Final.jar

      hibernate-ehcache-4.2.5.Final.jar

      hibernate-entitymanager-4.2.5.Final.jar

      hibernate-jpa-2.0-api-1.0.1.Final.jar

      itext.jar

      javassist-3.15.0-GA.jar

      javassist.jar

      jaxrs-api.jar

      jboss-el.jar

      jboss-logging-3.1.0.GA.jar

      jboss-seam-debug.jar

      jboss-seam-remoting.jar

      jboss-seam-resteasy.jar

      jboss-seam-ui.jar

      jboss-seam.jar

      jboss-transaction-api_1.1_spec-1.0.1.Final.jar

      jcommon.jar

      jfreechart.jar

      joda-time.jar

      jsf-api-2.2.2.jar

      jsf-impl-2.2.2.jar

      jstl-api-1.2.jar

      jta.jar

      jxl.jar

      log4j.jar

      mailapi.jar

      mysql-connector-java-5.1.22-bin.jar

      oscache-2.4.jar

      poi-3.9-20121203.jar

      poi-examples-3.9-20121203.jar

      poi-excelant-3.9-20121203.jar

      poi-ooxml-3.9-20121203.jar

      poi-ooxml-schemas-3.9-20121203.jar

      poi-scratchpad-3.9-20121203.jar

      resteasy-jaxrs.jar

      richfaces-components-api-4.3.3.Final.jar

      richfaces-components-ui-4.3.3.Final.jar

      richfaces-core-api-4.3.3.Final.jar

      richfaces-core-impl-4.3.3.Final.jar

      slf4j-api-1.6.1.jar

      xml-apis.jar

       

      Any insight that would shed some light on this matter would be greatly appreciated. Kindly let me know if any additional information is required to make a diagnosis.