Serialization bug in 1.1?

19 views
Skip to first unread message

jon918

unread,
Aug 14, 2006, 12:56:25 PM8/14/06
to Google Web Toolkit
I have an app that was working fine in 1.0.21, but is breaking during
the deserialization of an RPC request in 1.1. The problem is that
AbstractSerializationStreamReader's fSeenArray member variable doesn't
contain as many items as the code is expecting it to. (trace below)

Has anyone else seen this? Any further debug tips?

[WARN] StandardContext[]Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException:
java.lang.reflect.InvocationTargetException
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserizeWithCustomSerializer(ServerSerializationStreamReader.java:250)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:138)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:59)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:61)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeClass(ServerSerializationStreamReader.java:189)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:147)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:59)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:61)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:249)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:147)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
Caused by: java.lang.reflect.InvocationTargetException: null
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserizeWithCustomSerializer(ServerSerializationStreamReader.java:239)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:138)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:59)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:61)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeClass(ServerSerializationStreamReader.java:189)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:147)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:59)
Caused by: java.lang.IndexOutOfBoundsException: Index: 31, Size: 15
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.get(ArrayList.java:321)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:49)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:61)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeClass(ServerSerializationStreamReader.java:189)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:147)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:59)
at
com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.deserialize(ArrayList_CustomFieldSerializer.java:34)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Scott Blum

unread,
Aug 14, 2006, 2:40:11 PM8/14/06
to Google Web Toolkit
Hi jon,

Hard to tell much from the trace, but if you can email me your project
I'd be happy to look at it.

Scott

Scott Blum

unread,
Aug 15, 2006, 11:15:43 AM8/15/06
to jon918, Google Web Toolkit
Jon,

After examining your trace in more detail and correlating it with a problem that's been found, I may have a fix for you:

With a zip utility, go into gwt-user.jar/com/google/gwt/user/client/rpc/impl/ClientSerializationStreamWriter.java, line 101.  Change that line to read:

setIntForInt(System.identityHashCode(instance), objectCount++);

You may have to pull the file out of the jar, edit it, and replace it depending on your zip editor's capabilities.

Does this fix your problem?

Scott

On 8/15/06, jon918 <jon...@gmail.com> wrote:
Scott, thanks for the quick response. I am not able to send my whole
project. I was hoping that my lazy feeler might trigger some
suggestions, but will try to put together some more complete debug info
today or tomorrow.

jon918

unread,
Aug 15, 2006, 10:23:31 PM8/15/06
to Google Web Toolkit
Scott,

Your suggestion did in fact fix the problem. Sorry it took me a while
to get back to you.

Thanks for the quick feedback. Keep up the great work GWT team!

Jon

Andrey Agranov

unread,
Aug 21, 2006, 9:26:55 AM8/21/06
to Google Web Toolkit
Hi, Scott.
I experienced problems (stack overflow) during serialization of objects
with bidirectional relation, in version 1.1
I found the same cause and did the same fix and it worked.
It's a bug, nothing to say....

Scott Blum

unread,
Aug 21, 2006, 2:45:42 PM8/21/06
to Google-We...@googlegroups.com
Thanks, Andrey.

Yes, this one bug is responsible for all sorts of flaky behavior, from
infinite loops on the client to a failure to deserialize on the
server. This bug is probably the worst one we've let out the door!
We're going to be putting out a bugfix release soon with this fixed.

Scott

thripper

unread,
Aug 29, 2006, 7:02:23 PM8/29/06
to Google Web Toolkit
Took me some 2 days and a lot of debugging until realised it must be a
bug.

Tnx for the hot fix tough. I'll post back after i try it.

Reply all
Reply to author
Forward
0 new messages