users@glassfish.java.net

Invalid Chunk Header

From: <glassfish_at_javadesktop.org>
Date: Wed, 20 Jan 2010 05:50:00 PST

Hi,

I'm running a webservice with a JavaME client program.
For one specific mobile device i receive an IOException (stacktrace below) with message "Invalid chunk header".
I have already found the thread
http://forums.java.net/jive/thread.jspa?messageID=374212&#374212
where the same problem is described.
I applied the patch from
https://glassfish.dev.java.net/issues/show_bug.cgi?id=6303 and set the jvm-options they mentioned in the thread but i still get the "invalid chunk header" message.

I captured the network traffic for both a successful and an unsuccessful request
(attachment cap-file).
Frame 20 and 22 show the successful request.
Frame 75 and 76 show the unsuccessful request.
As you can see frame 76 only contains the "chunk-lenght" part of the chunked http content. The data part is sent in frame 79 but Glassfish had already sent the "invalid chunk header" response in frame 77.

Is this a client or should Glassfish usually accept the chunked body split over multiple frames and there is something wrong with the server?

Best regards,

Hendrik

Message ID java.io.IOException
Complete Message Invalid chunk header at com.sun.grizzly.tcp.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:169) at com.sun.grizzly.tcp.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:736) at com.sun.grizzly.tcp.Request.doRead(Request.java:490) at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:331) at com.sun.grizzly.util.buf.ByteChunk.substract(ByteChunk.java:378) at org.apache.catalina.connector.InputBuffer.readByte(InputBuffer.java:343) at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:161) at java.io.DataInputStream.readShort(DataInputStream.java:295) at com.sanderdoll.ws.WebToMobileServlet.doPost(WebToMobileServlet.java:117) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:619)
[Message sent by forum member 'hsirges' (hsirges_at_sander-doll.com)]

http://forums.java.net/jive/thread.jspa?messageID=381949