I'm using the GAE Java Dev Server (i.e. Jetty).
When I request a page that sends a large amount of cookie data to the
browser and then re-request the page (so that the browser sends the
cookies back to the server) I get this stacktrace:
==========
Nov 13, 2009 6:35:13 PM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: handle failed
java.io.IOException: FULL head
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:276)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:396)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run
(BoundedThreadPool.java:442)
==========
The behavior I see is that the browser receives what seems to be a
completely empty response body, and the access log does not show the
request at all (likely because the request/response protocol was
halted when the exception occured). If I configure my browser to send
its requests through a diagnostic proxy tool, I can see that the
request headers being sent are about 5k total. But the response takes
2-3 minutes to come. Once it does, the proxy tool shows me only
response headers (no response body):
=======
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: <cookie name 1>=<cookie value 1>
Set-Cookie: <cookie name 2>=<cookie value 2>
Set-Cookie: <cookie name 3>=<cookie value 3>
Transfer-Encoding: chunked
Server: Jetty(6.1.x)
=======
which I suppose explains why the browser renders it as an empty
response.
I found a clue here:
http://mail-archives.apache.org/mod_mbox/geronimo-dev/200711.mbox/%3c8189103.1194033655205.javamail.j...@brutus%3e
I've confirmed that if I delete the cookies from my browser and re-
request... the problem does not occur for that request.
In other words the problem only occurs when the browser is sending a
large amount of request headers (In my case cookies it already
received from a previous request to the test page).
However the solution given is to switch from Jetty to Tomcat, which is
not something that can be done when using GAE Java Dev server.
So... does anyone know if the Jetty that's bundled with GAE Java Dev
Server can be configured to use a larger buffer for the *request*
headers?
And if so... how?
A JVM System property perhaps... passed in the WEB-INF/appengine-
web.xml file?
I also ran the same test/request on regular (non-Google App Engine)
Jetty (v 6.1.16) and get the same observed behavior (empty response
received) however the stacktrace is quite different suggesting that
the problem is now with the size of the buffer used for the *response*
headers:
=========
java.lang.ArrayIndexOutOfBoundsException: 4096
at org.mortbay.io.ByteArrayBuffer.poke(ByteArrayBuffer.java:
268)
at org.mortbay.io.AbstractBuffer.put(AbstractBuffer.java:456)
at org.mortbay.jetty.HttpFields$Field.put(HttpFields.java:
1384)
at org.mortbay.jetty.HttpGenerator.completeHeader
(HttpGenerator.java:523
)
at org.mortbay.jetty.HttpConnection.commitResponse
(HttpConnection.java:6
11)
at org.mortbay.jetty.HttpConnection$Output.flush
(HttpConnection.java:946
)
at org.mortbay.jetty.AbstractGenerator$OutputWriter.flush
(AbstractGenera
tor.java:733)
at java.io.PrintWriter.flush(Unknown Source)
=========
I once again configured my browser to send all its requests through my
diagnostic proxy tool.
The tool shows me that the response that comes from Jetty (after 2-3
minutes) is:
====
HTTP/1.1 413 FULL head
Connection: close
Server: Jetty(6.1.16)
====
The 413 Response status code means "Request Entity Too Large" and the
HTTP spec says that the server may close the connection in that case.
Once again I used my proxy tool to confirm that the size of the
request headers is about 5k.
In all cases it is a simple GET request so there is no request body
(i.e. payload).
Can't Jetty take more than 5k of request headers???
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=.