I've run into an error which may be either a bug or the result of a misconfiguration. When I try to set a large cookie, I get the following error:

2009-feb-11 15:56:00 org.apache.catalina.connector.CoyoteAdapter service
ALLVARLIG: An exception or error occurred in the container during the request processing
java.lang.ArrayIndexOutOfBoundsException: 8192
at org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:714) at org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:621) at org.apache.coyote.http11.InternalOutputBuffer.sendHeader(InternalOutputBuffer.java:494) at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1600) at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:935)
        at org.apache.coyote.Response.action(Response.java:183)
        at org.apache.coyote.Response.sendHeaders(Response.java:379)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)
        at 
org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:273)
        at 
org.apache.catalina.connector.Response.finishResponse(Response.java:492)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:310) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
2009-feb-11 15:56:00 org.apache.coyote.http11.Http11Processor process
ALLVARLIG: Error finishing response
java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
at org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:683) at org.apache.coyote.http11.InternalOutputBuffer.sendStatus(InternalOutputBuffer.java:419) at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1589) at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:935)
        at org.apache.coyote.Response.action(Response.java:181)
at org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutputBuffer.java:379) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:880) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)


(... where, I assume, ALLVARLIG is SEVERE l10n:ed into Swedish.) The server works fine afterwards, it's only this specific request that fails.

I found this while setting very large cookies. It apparently happens for all large headers, the attached JSP provokes this exception for me.

System info:

OS:     Windows Vista x64
HW:     Dell Latitude e6500, Intel Core II Duo, 4GB RAM, 2.64GHz
Java:   java version "1.6.0_10"
Tomcat: 6.0.18, running from Eclipse plugin

Is this a well-known issue? I've done my googling and found http://www.mail-archive.com/users@tomcat.apache.org/msg46316.html but no resolution is presented there.

Thanks in advance,

/g
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%!
private static String repeat(char c, int n) {
        StringBuilder sb = new StringBuilder();
        while(sb.length() < n)sb.append(c);
        return sb.toString();
}
%>
<%

response.addHeader("X-Borked-0", repeat('a', 2048));
response.addHeader("X-Borked-1", repeat('b', 2048));
response.addHeader("X-Borked-2", repeat('c', 2048));
response.addHeader("X-Borked-3", repeat('d', 2048));

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Oh noes!</title>
</head>
<body>
You won't see this.
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to