I'm serializing to the client from Java using the standard GWT RPC
mechanism (using Async Service, not the factory introduced in 2.1).
I'm seeing an issue with deserialization at the client when my
serialized object has circular references. This is what I see:
Serializing a "Result" object that has a "Fund" object reference. This
fund has a reference to a "Distributor" object that contains a list of
Funds, one of which is the same as the Fund that result references. So
it is a two-hop circular reference.
The Fund object's hashCode method is overridden to use the fund-id's
hashcode (fund-id is a string). The error I get is that the hashcode
threw a NullPointerException.
Here is the stacktrace:
at com.foo.dm.fund.Fund.hashCode(Fund.java:709)
at java.util.HashMap.put(HashMap.java:372)
at java.util.HashSet.add(HashSet.java:200)
at
com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.deserialize(Collection_CustomFieldSerializerBase.java:35)
at
com.google.gwt.user.client.rpc.core.java.util.HashSet_CustomFieldSerializer.deserialize(HashSet_CustomFieldSerializer.java:32)
at
com.google.gwt.user.client.rpc.core.java.util.HashSet_FieldSerializer$Handler.deserialize(HashSet_FieldSerializer.java:11)
at
com.google.gwt.user.client.rpc.impl.SerializerBase.deserialize(SerializerBase.java:91)
at
com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:108)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at
com.foo.dm.user.Distributor_FieldSerializer.deserialize(Distributor_FieldSerializer.java:42)
Are circular references not allowed? I can't believe this is the first
time I'm running across this in 2 years!
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" 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-web-toolkit?hl=en.