Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerializationException: Too few tokens in RPC request #319

Closed
dhoffer opened this issue Apr 30, 2012 · 2 comments
Closed

SerializationException: Too few tokens in RPC request #319

dhoffer opened this issue Apr 30, 2012 · 2 comments

Comments

@dhoffer
Copy link

dhoffer commented Apr 30, 2012

Using 0.9 (and 0.9.1) I occasionally get the following error:

30 Apr 2012 13:54:48,953 ERROR AtmosphereHandler []: Failed to deserialize message
com.google.gwt.user.client.rpc.SerializationException: Too few tokens in RPC request
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:809)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeStringTable(ServerSerializationStreamReader.java:735)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:449)
at org.atmosphere.gwt.server.AtmosphereGwtHandler.deserialize(AtmosphereGwtHandler.java:283)
at ipt.tas.chatdashboard.ui.gwt.server.AtmosphereHandler.deserialize(AtmosphereHandler.java:68)
at org.atmosphere.gwt.server.AtmosphereGwtHandler.doServerMessage(AtmosphereGwtHandler.java:237)
at org.atmosphere.gwt.server.AtmosphereGwtHandler.onRequest(AtmosphereGwtHandler.java:183)
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:217)
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
at org.atmosphere.container.JettyCometSupport.service(JettyCometSupport.java:99)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1162)
at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:293)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.IndexOutOfBoundsException: Index: 11, Size: 11
at java.util.ArrayList.rangeCheck(ArrayList.java:604)
at java.util.ArrayList.get(ArrayList.java:382)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:807)
... 30 more

I've tracked down one case that causes this. If AtmosphereGwtHandler's deserialize() method gets the following string data to deserialize it will cause this error.

7|0|9|http://127.0.0.1:8888/dashboard/|HostedMode|ipt.tas.chatdashboard.ui.gwt.client.GWTClientPayload/4245197585|[Lipt.tas.chatdashboard.ui.gwt.client.IGWTMessage;/2108189492|ipt.tas.chatdashboard.ui.gwt.client.viewmanager.GWTViewInstructionResult/875962610|ipt.tas.chatdashboard.ui.gwt.client.UUIDReference/2484332177|3eb54d57-e578-45f7-85f3-8f8a5c59752a|java.lang.String/2004016611|&lt;div style="font-family: Arial; font-size: 10pt;"><div class="chatline" style="text-indent:-10px; margin-left:10px;"><span class="timestamp-self" style="color:#FF0000;">(Apr 30 2012 13:54:12) </span><span class="from-self" style="color:#FF0000;">tom: </span><span class="message">123</span></div>

Is this because of the HTML escape sequences? Shouldn't RPC be able to handle any characters?

@dhoffer
Copy link
Author

dhoffer commented Apr 30, 2012

7|0|9|http://127.0.0.1:8888/dashboard/|HostedMode|ipt.tas.chatdashboard.ui.gwt.client.GWTClientPayload/4245197585|[Lipt.tas.chatdashboard.ui.gwt.client.IGWTMessage;/2108189492|ipt.tas.chatdashboard.ui.gwt.client.viewmanager.GWTViewInstructionResult/875962610|ipt.tas.chatdashboard.ui.gwt.client.UUIDReference/2484332177|3eb54d57-e578-45f7-85f3-8f8a5c59752a|java.lang.String/2004016611|&lt;div style=&quot;font-family: Arial; font-size: 10pt;&quot;&gt;&lt;div class=&quot;chatline&quot; style=&quot;text-indent:-10px; margin-left:10px;&quot;&gt;&lt;span class=&quot;timestamp-self&quot; style=&quot;color:#FF0000;&quot;&gt;(Apr 30 2012 13:54:12) &lt;/span&gt;&lt;span class=&quot;from-self&quot; style=&quot;color:#FF0000;&quot;&gt;tom: &lt;/span&gt;&lt;span class=&quot;message&quot;&gt;123&lt;/span&gt;&lt;/div&gt;

@jfarcand
Copy link
Member

Closing that one as duplicate of #320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants