3 Replies Latest reply on Jul 18, 2011 3:03 AM by F M

    [Richfaces 4] rich:panelMenu triggers IllegalStateException: Cannot create a session after the response has been committed

    F M Newbie

      Hi,

       

      I'm trying to setup a new project using JSF2 / Richfaces 4.0.0.Final on Tomcat 6. Everything works fine but the rich:panelMenu.

       

      I took the example from the Richfaces 4 Showcase (i just changed the mode to "client") and the web.xml configuration from the project generated by the richfaces-archetype-simpleapp maven artifact.

       

      When I try to access my page, I get the following stacktrace. Sorry for the french, but I could't find how to change the locale of JSF2 error message (if you know that, I'm interrested !). The english message is: "java.lang.IllegalStateException: Cannot create a session after the response has been committed".

       

      23 juin 2011 11:43:46 com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException

      GRAVE: Error Rendering View[/pages/home.xhtml]

      java.lang.IllegalStateException: Impossible de créer une session après que la réponse ait été envoyée

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

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

           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)

      23 juin 2011 11:43:46 org.apache.catalina.core.StandardWrapperValve invoke

      GRAVE: "Servlet.service()" pour la servlet Faces Servlet a généré une exception

      java.lang.IllegalStateException

           at org.apache.catalina.connector.ResponseFacade.reset(ResponseFacade.java:310)

           at com.sun.faces.context.ExternalContextImpl.responseReset(ExternalContextImpl.java:821)

           at javax.faces.context.ExternalContextWrapper.responseReset(ExternalContextWrapper.java:777)

           at com.sun.faces.context.ExceptionHandlerImpl.throwIt(ExceptionHandlerImpl.java:251)

           at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:141)

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

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

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

           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)

       

       

      The page on my browser only contains the rich:panelMenu, which works well, but without anything else on the page (the menu is first on the template).

       

      I joined the page, the template and the web.xml of my application.

       

      Any idea is welcomed, I'm stuck here...

      Thanks in advance,

       

      FMT