myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Green (JIRA)" <myfaces-...@incubator.apache.org>
Subject [jira] Created: (MYFACES-612) IllegalStateException: Cannot forward after response has been committed
Date Fri, 23 Sep 2005 14:38:28 GMT
IllegalStateException: Cannot forward after response has been committed
-----------------------------------------------------------------------

         Key: MYFACES-612
         URL: http://issues.apache.org/jira/browse/MYFACES-612
     Project: MyFaces
        Type: Bug
  Components: Implementation  
    Versions: 1.1.0    
 Environment: Tomcat 5.5.7, Sun JDK 1.5.0, Mozilla 1.7.10 and Linux.
    Reporter: Jeremy Green


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


Mime
View raw message