----- Original Message ----- From: "Roy, Jaideep" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, December 05, 2000 8:52 PM Subject: Content-Length errors thrown when attempting to forward to a page > Our development team has been occasionally seeing the following error > (listed below) thrown from Orion. This happens when our application running > under Orion throws an error and attempts to forward to our custom error JSP > page. > > The error happens sporadically and cannot be recreated consistently, but > tends to bring the server down (i.e. accepts no more connections/requests). > Also, the browser never gets a response back from the server. This has also > been reported by some other users in the orion-interest archives. > > Any ideas as to what could cause this problem? > > > Root cause is; java.lang.IllegalArgumentException: Attempted to write longer > than Content-Length (5316 + 3607 / 5316) I had a similar problem when using response.sendRedirect(). I don't know whether the same applies to you, but in our our code we had a section like: <% if( some_condition ) response.sendRedirect(another_url); %> <html stuff> The problem is that response.sendRedirect() sends off the forward request to the browser and continues to output the html because there is no return or else statement blocking it ( programming oversight:-( ). In combination with http keep-alives, this means that sometimes the rest of the jsp file is outputted simultaneously down the same socket connection as the newly requested file from the sendRedirect(). This exceeds the content-length that has been calculated for just one file and causes the error. I don't know whether this can be classed as an Orion bug ( not synchronizing access to sockets ) or a programming error ( not returning or elsing the sendRedirect() ). If the above example is changed to <% if( some_condition ) { response.sendRedirect(another_url); return; } %> <html stuff> then everything works fine. HTH Mike -- Java Developer tw2.com