You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Jeremy Green (JIRA)" <de...@myfaces.apache.org> on 2006/05/28 16:22:31 UTC

[jira] Commented: (MYFACES-612) IllegalStateException: Cannot forward after response has been committed

    [ http://issues.apache.org/jira/browse/MYFACES-612?page=comments#action_12413628 ] 

Jeremy Green commented on MYFACES-612:
--------------------------------------

I''ve just tried upgrading to MyFaces core 1.1.3, and both my test application (above) and real application still fail:

.
.
2006-05-28 15:05:22,316 DEBUG lifecycle.LifecycleImpl - entering renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl
2006-05-28 15:05:22,316 DEBUG jsp.JspViewHandlerImpl - Dispatching to /index.jsp
2006-05-28 15:05:22,316 DEBUG core.ApplicationDispatcher - servletPath=/index.jsp, pathInfo=null, queryString=null, name=null
2006-05-28 15:05:22,316 DEBUG core.ApplicationDispatcher -   Forward on committed response --> ISE
2006-05-28 15:05:22,342 ERROR StandardWrapper[/IllegalStateExceptionProblem:facesServlet] - Servlet.service() for servlet facesServlet threw exception
java.lang.IllegalStateException: Cannot forward after response has been committed
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:314)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
.
.

This problem is still serious enough to prevent my real application's public deployment. If there's any more information I can provide / things I could do to help fix this, let me know.

> IllegalStateException: Cannot forward after response has been committed
> -----------------------------------------------------------------------
>
>          Key: MYFACES-612
>          URL: http://issues.apache.org/jira/browse/MYFACES-612
>      Project: MyFaces Core
>         Type: Bug

>   Components: General
>     Versions: 1.1.0
>  Environment: Tomcat 5.5.7, Sun JDK 1.5.0, Mozilla 1.7.10 and Linux.
>     Reporter: Jeremy Green
>     Assignee: Manfred Geiler

>
> Rapid, multiple clicks on the h:commandButton in the test case given below 
> produce an IllegalStateException and a blank response about 10% of the time.
> The JSF state-saving method can be client or server. A blank page is sometimes
> returned even if the clicks are not rapid.
> The Sun JSF RI 1.1_01 shows the same problem:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6326655
> The stack trace is:
> SEVERE: Servlet.service() for servlet Faces Servlet threw exception
> java.lang.IllegalStateException: Cannot forward after response has been committed
>         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:314)
>         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
>         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
>         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
>         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
>         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:214)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>         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:825)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
>         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
>         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>         at java.lang.Thread.run(Thread.java:595)
> Here is the test case:
> index.jsp:
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <html>
>     <head></head>
>     <body>
>         <f:view>
>             <h:form>
>                 <p>
>                     <h:commandButton value="Submit" />
>                 </p>
>                 <p>
>                     <h:graphicImage value="image.png" />
>                 </p>
>             </h:form>
>         </f:view>
>     </body>
> </html>
> SlowServlet.java, mapped to image.png in web.xml:
> public class SlowServlet extends HttpServlet {
>     
>     protected void doGet(HttpServletRequest req, HttpServletResponse resp)
>     throws ServletException, IOException {
>         
>         BufferedImage image;
>         OutputStream os;
>         
>         image = new BufferedImage(100, 100,
>              BufferedImage.TYPE_INT_ARGB);
>         os = resp.getOutputStream();
>         resp.setContentType("image/png");
>         try {
>             Thread.sleep(1000);
>         } catch (InterruptedException e) {
>             throw new ServletException(e);
>         }
>         try {
>             ImageIO.write(image, "png", os);
>             os.close();
>         } catch (IOException e) {
>         }
>         
>     }
>     
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira