Two Laptop Bag*
The moose likes JSF and the fly likes Cannot create a session after the response has been committed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Cannot create a session after the response has been committed" Watch "Cannot create a session after the response has been committed" New topic
Author

Cannot create a session after the response has been committed

Priyanka Sumanam
Greenhorn

Joined: Aug 17, 2010
Posts: 25
I am using JSF with tomcat 7.0.8 .I am getting the below exception in application after the session time out instead of getting a session time out alert, and its throwing a 500 Error on screen.

10/07/2011 1:58:20 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/biosirt] threw exception [Cannot create a session after the response has been committed] with root cause
java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2691)
at org.apache.catalina.connector.Request.getSession(Request.java:2228)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:899)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession(ServletExternalContextImpl.java:197)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.nextViewSequence(JspStateManagerImpl.java:544)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.getSerializedViewFromServletSession(JspStateManagerImpl.java:536)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:255)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:283)
at org.ajax4jsf.framework.ajax.AjaxStateManager.restoreView(AjaxStateManager.java:83)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255)
at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:150)
at org.apache.shale.view.faces.ViewViewHandler.restoreView(ViewViewHandler.java:164)
at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:150)
at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:141)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:268)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

could any one help me in sorting this out
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Cannot create a session after the response has been committed
 
Similar Threads
datatable selection returning null
JASPER export to pdf using Servlet Detail not show..help please
java.lang.NullPointerException at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForWriting
Problem while uploading file using <t:inputFileUpload>
JDBC in JSP not working