Re: [Resin-interest] java.lang.IllegalStateException: forward() not allowed after buffer has committed.

2008-01-16 Thread Scott Ferguson

On Jan 15, 2008, at 1:45 PM, Huitang Li wrote:

> Hi,
>
> When we upgrade to resin3.1.4 from resin 2, we got the following error
> when we access a page:
>
> java.lang.IllegalStateException: forward() not allowed after buffer  
> has
> committed.
> [14:20:59.218] at
> com.caucho.jsp.PageContextImpl.include(PageContextImpl.java:1002)
> [14:20:59.218] at
> _jsp._aaa._bbb._ccc__jsp._jspService(_ddd__jsp.java:128)
> (  <= corresponding to ddd.jsp )
> ..
>
> In ddd.jsp, the line is
>
> 

You might need to set flush="false" (although I thought we'd reversed  
that change).

The exception is thrown when you try to forward/redirect after some  
data has been flushed to the browser (which makes forwarding/ 
redirection impossible.)

-- Scott

>
>
> I debugged with  resin 3.1.4 source code, and found that the exception
> is thrown from the following lines in the class  
> RequestDispatcherImpl in
> package com.caucho.server.webapp:
>
>if (res.isCommitted() && method == null) {
>   IllegalStateException exn;
>   exn = new IllegalStateException("forward() not allowed after
> buffer has committed.");
>
>   if (cauchoRes == null || ! cauchoRes.hasError()) {
> if (cauchoRes != null)
>   cauchoRes.setHasError(true);
> throw exn;
>   }
>
>   _webApp.log(exn.getMessage(), exn);
> }
>
> One interesting thing is that when the jsp page is accessed for the
> first time, it is forwarded to the error page with such exception.
> However, the jsp page is correctly rendered in following  requests  
> even
> though the same exception is generated.
>
> Does anyone know the solution?
>
> Thanks.
>
>
>
>
>
>
>
>
>
>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] java.lang.IllegalStateException: forward() not allowed after buffer has committed.

2008-01-15 Thread Huitang Li
Hi,

When we upgrade to resin3.1.4 from resin 2, we got the following error 
when we access a page:

java.lang.IllegalStateException: forward() not allowed after buffer has 
committed.
[14:20:59.218] at 
com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:141)
[14:20:59.218] at 
com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:108)
[14:20:59.218] at 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
[14:20:59.218] at 
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
[14:20:59.218] at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
[14:20:59.218] at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
[14:20:59.218] at 
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
[14:20:59.218] at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
[14:20:59.218] at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
[14:20:59.218] at 
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
[14:20:59.218] at 
com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:97)
[14:20:59.218] at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:266)
[14:20:59.218] at 
com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:491)
[14:20:59.218] at 
com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:355)
[14:20:59.218] at 
com.caucho.jsp.PageContextImpl.include(PageContextImpl.java:1002)
[14:20:59.218] at 
_jsp._aaa._bbb._ccc__jsp._jspService(_ddd__jsp.java:128)  
(  <= corresponding to ddd.jsp )
..

In ddd.jsp, the line is




I debugged with  resin 3.1.4 source code, and found that the exception 
is thrown from the following lines in the class RequestDispatcherImpl in 
package com.caucho.server.webapp:

   if (res.isCommitted() && method == null) {
  IllegalStateException exn;
  exn = new IllegalStateException("forward() not allowed after 
buffer has committed.");

  if (cauchoRes == null || ! cauchoRes.hasError()) {
if (cauchoRes != null)
  cauchoRes.setHasError(true);
throw exn;
  }
 
  _webApp.log(exn.getMessage(), exn);
}

One interesting thing is that when the jsp page is accessed for the 
first time, it is forwarded to the error page with such exception. 
However, the jsp page is correctly rendered in following  requests even 
though the same exception is generated.

Does anyone know the solution?

Thanks.


 









___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest