3 Replies Latest reply on Jan 30, 2012 11:50 AM by John Aja

    rich:tabPanel Cannot create a session after the response has been committed tomcat error

    John Aja Newbie

      Hi,

       

      I have a web application using RichFaces 4.1 mojarra 2.0.2 and apache tomcat 6.0.32.

      I would like to use mojarra 2.1.6 but I am getting an error when I am using it.

      My code seems only to work with mojarra 2.0.2.

      I am using a rich tab panel and it seems to be causing an error.

       

      Below is my code and the error being generated when I use mojarra 2.1.6 or any other 2.1 mojarra versions:

       

      Code:


      {code:xml}<rich:tabPanel switchType="client" >

                      <rich:tab header="Overview">

                          <rich:collapsiblePanel header="Overview" switchType="client" styleClass="overview-collapsible-panel">

                              <div class="overview-label-wrapper">

                                  <span class="overview-label">Total Number of Applications:</span> 5

                              </div>

                          </rich:collapsiblePanel>

                          <rich:collapsiblePanel header="Licensing" switchType="client" styleClass="overview-collapsible-panel">

                              <div  class="overview-label-wrapper">

                                  <span class="overview-label">Total Number of Licenses Available:</span> 10

                              </div>

                          </rich:collapsiblePanel>

                      </rich:tab>

                      <rich:tab header="Options">

                          <rich:collapsiblePanel header="General Options" switchType="client"

                                     styleClass="overview-collapsible-panel">

                                  <div class="options-input">

                                      <rich:select value="0">

                                          <f:selectItem itemValue="0" itemLabel="Trace"/>

                                          <f:selectItem itemValue="1" itemLabel="Info" />

                                      </rich:select>

                                  </div>

                          </rich:collapsiblePanel>

                      </rich:tab>

                  </rich:tabPanel>{code}

       

       

       

      Tomcat Error:

       

       

       

      INFO: Initializing Mojarra 2.1.7 (SNAPSHOT 20111222) for context '/bpitest'

      Jan 18, 2012 10:58:17 AM org.richfaces.javascript.ClientServiceConfigParser parse

      WARNING: Found JavaScript function definition for class org.hibernate.validator.constraints.NotEmpty, but that class is not presented

      Jan 18, 2012 10:58:17 AM org.richfaces.cache.CacheManager getCacheFactory

      INFO: Selected fallback cache factory

      Jan 18, 2012 10:58:17 AM org.richfaces.cache.lru.LRUMapCacheFactory createCache

      INFO: Creating LRUMap cache instance using parameters: {javax.faces.PROJECT_STAGE=Production}

      Jan 18, 2012 10:58:17 AM org.richfaces.cache.lru.LRUMapCacheFactory createCache

      INFO: Creating LRUMap cache instance of 512 items capacity

      Jan 18, 2012 10:58:17 AM org.richfaces.application.InitializationListener onStart

      INFO: RichFaces Core Implementation by JBoss, a division of Red Hat, Inc., version v.4.1.0.Final

      Jan 18, 2012 12:56:21 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException

      SEVERE: Error Rendering View[/index.xhtml]

      java.lang.IllegalStateException: Cannot create a session after the response has been committed

      at org.apache.catalina.connector.Request.doGetSession(Request.java:2400)

      at org.apache.catalina.connector.Request.getSession(Request.java:2120)

      at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)

      at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:155)

      at javax.faces.context.ExternalContextWrapper.getSession(ExternalContextWrapper.java:396)

      at com.sun.faces.renderkit.ServerSideStateHelper.writeState(ServerSideStateHelper.java:175)

      at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:122)

      at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:166)

      at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)

      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:419)

      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)

      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)

      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)

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

      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

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

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

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

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

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

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

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

      Jan 18, 2012 12:56:22 PM com.sun.faces.context.ExceptionHandlerImpl throwIt

      INFO: Exception when handling error trying to reset the response.

      java.lang.IllegalStateException: Cannot create a session after the response has been committed

      at org.apache.catalina.connector.Request.doGetSession(Request.java:2400)

      at org.apache.catalina.connector.Request.getSession(Request.java:2120)

      at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)

      at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:155)

      at javax.faces.context.ExternalContextWrapper.getSession(ExternalContextWrapper.java:396)

      at com.sun.faces.renderkit.ServerSideStateHelper.writeState(ServerSideStateHelper.java:175)

      at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:122)

      at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:166)

      at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)

      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:419)

      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)

      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)

      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)

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

      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

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

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

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

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

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

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

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

       

       

       

      This error happens after I send another request.

      So the first time let's say I open it in firefox it is fine then I open it in another tab or I open in IE I basically send another request and I see the error being displayed.

      If I don't use the rich tabpanel component I don't get the error and everything is ok.

      Also, if I use mojarra 2.0.2 everything is ok.

      I see this problem when I use the rich tabpanel and any mojarra 2.1 versions.