Mantis - Resin
Viewing Issue Advanced Details
4025 major random 05-04-10 00:12 05-19-10 15:32
closed 4.0.6  
none 4.0.7  
0004025: sendRedirect fails
In some pages sendRedirect fails where 3.1 works fine. The server seems to try to redirect and in a time fails to redirect.

I get an error in jvm_default.log

java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(
at com.caucho.server.hmux.HmuxRequest.onCloseConnection(
at com.caucho.server.connection.TcpConnection.closeImpl(
at com.caucho.server.connection.TcpConnection.destroy(
at com.caucho.server.connection.TcpConnection.handleRequests(
at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(
at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(
at com.caucho.server.connection.TcpConnection$
at com.caucho.util.ThreadPool$PoolThread.runTasks(
at com.caucho.util.ThreadPool$

I'm trying to make some simple code to reproduce error

05-04-10 02:30   
Still not able to generate simple code to reproduce it. The pages we use worked fine in 3.1 and 2 versions. The page is not fully correct but worked fine in that versions.

What the pages do:
if (condition) {
generate html code

We know that the correct one is this:
if (condition) {
else {
   generate html code

but when the application was created we thought that sendRedirect jumped to the page and stop the execution in the correct page.
05-13-10 16:31   
vicsanca, I wasn't able to reproduce the error. I think it may be caused by a downsizing the buffers in version 4.
Do you use <%@page buffer directive on your page? What's that set to if so?
What are you using for load balancing ( apache / iis / resin ? ) Thanks!
05-13-10 16:42   
On that same note: sendRedirect should not be failing due to the issue in stacktrace. It can be failing with IllegalStateException if the output has already been flushed due to buffer overflow or an explicit flushing of the buffers.
05-16-10 23:45   
We use resin with Apache 2.2 and
We don't use buffer directive.
We are able to reproduce the error in our application but not to generate simple code to post you.
05-17-10 05:46   
Yes seems that adding buffer page directive with a high value works:
1kb - fails
8kb - fails
16kb - works :)

It's a bug or there is an option for increasing default buffer for all pages without the buffer directive?
05-17-10 08:02   
Thanks for clarification. You can include the <%@ page buffer using <jsp-config include-prelude.
05-17-10 23:58   
What buffer size it's configured by default in 3.1.x?
It's possible to change it in 4.0 in source code before compiling to put the same? if possible where is the buffer size in source code?

05-19-10 15:32