RPC exception

19 views
Skip to first unread message

Ryan Dewsbury

unread,
Aug 31, 2006, 1:15:26 PM8/31/06
to Google Web Toolkit
Every 5-10 minutes on a server with constant RPC calls I get the
following exception:

SEVERE: Exception while dispatching incoming RPC call
javax.servlet.ServletException: Client did not send 83 bytes as
expected
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.readPayloadAsUtf8(RemoteServiceServlet.java:532)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:142)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

... and its always 83 bytes. Does anybody have an idea why?

Miguel Méndez

unread,
Sep 1, 2006, 2:56:46 PM9/1/06
to Google-We...@googlegroups.com
Hello Ryan,

The length stated in the Content-length header of the HTTP request was less than what was actually provided.  Do you have any idea what the data that causes is this problem is?  That would help to focus the search.

Thanks,

On 8/31/06, Ryan Dewsbury <dews...@gmail.com> wrote:

Every 5-10 minutes on a server with constant RPC calls I get the
following exception:

SEVERE: Exception while dispatching incoming RPC call
javax.servlet.ServletException: Client did not send 83 bytes as
expected
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.readPayloadAsUtf8(RemoteServiceServlet.java:532)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java :142)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:252)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java :213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)

        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
        at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
        at
org.apache.jk.common.ChannelSocket.invoke (ChannelSocket.java:754)

        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
        at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)



... and its always 83 bytes. Does anybody have an idea why?





--
Miguel

Ryan Dewsbury

unread,
Sep 5, 2006, 5:43:10 PM9/5/06
to Google Web Toolkit
Hi Miguel,

All I have right now is that stack trace. I've only been able to see it
in a production environment. I see the exception after looking at the
tomcat logs.

Perhaps it is users with older cached js files?

One thing I'm seeing regularly is RPC calls being dropped without an
onFailure() event being fired. I know that exceptions thrown in my code
on the server will cause the RPC call to fail. But if an exception
within the RPC code like this happens could it cause the call to hang?
Is there a timeout on RPC calls if the server fails to return?

Miguel Méndez

unread,
Sep 8, 2006, 2:10:22 PM9/8/06
to Google-We...@googlegroups.com
Hello Ryan,

It is possible that older cached JS files could be causing a problem.  However, in that case the failure would occur during the decoding of the contents of RPC request and not while reading the HTTP request payload.  This feels more like a browser or a data issue to me.

There is no timeout on an RPC call so if the failure or success response from the server never makes it back to the client it would hang.  However, it should never be the case that the exception shown in your log does not also result in onFailure being called.  It would take an exception other than an IOException inside of the RemoteServiceServlet.respondWithFailure(HttpServletResponse, Throwable) method for this to happen.  (An IllegalStateException from the HttpServletResponse.getWriter() method would be an example of this)

It sounds like we could be talking about a couple of different problems here.  One where the client does not send enough bytes in the HttpServletRequest and another where server responses are being lost.  For the first issue, I would be interested in knowing what the payload of the client request is supposed to be when you see the "under run".  For the second issue, have you overridden any of the RemoteServiceServlet methods?
--
Miguel

Ryan Dewsbury

unread,
Sep 10, 2006, 11:44:05 PM9/10/06
to Google Web Toolkit
The RPC call who's length is 83 bytes is a call with an integer
parameter, and returns an object. The return value is probably
irrelevant.

I've notices this problem with a couple other content lengths, probably
representing other functions. Errors with these other methods don't
occur as much but the methods are not called as much as the 83 byte
method.

I still haven't obtained the bytes of the under run, but i suspect its
the same as the successful 83 byte call with the end cut off.

It doesn't happen often. There are about 100 RPC calls/second and the
exception shows up approx every 10 minutes.

I am going to write this off as the user closing their
browser/disconnecting before the server has a chance to read all of the
data.

Miguel Méndez

unread,
Sep 11, 2006, 11:12:12 AM9/11/06
to Google-We...@googlegroups.com
Ryan,

I think that you are right.  The return object is irrelevant.  However, it is possible that there is a magic int value that causes this to occur.

From my end, I'll keep an eye out for this issue.  If you do come up with some data please send it my way for a post mortem.

Thanks,
--
Miguel
Reply all
Reply to author
Forward
0 new messages