GWT 1.5 Invalid type signature

1,385 views
Skip to first unread message

beddoes

unread,
Jun 3, 2008, 9:56:53 AM6/3/08
to Google Web Toolkit
Hi All,
I have been doing some development work with GWT 1.5m2 over the past
few days, specifically porting some of the RPC server side stuff to
work in an OSGi bundle scenario.

At this point in time I pretty much have all RPC calls working
correctly except for those involving a List. When sending data
involving a list of string values back to the server I get:

Caused by: com.google.gwt.user.client.rpc.SerializationException:
Invalid type signature for java.util.ArrayList
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.validateTypeVersions(ServerSerializationStreamReader.java:
654)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:
457)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:
61)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader
$ValueReader$8.readValue(ServerSerializationStreamReader.java:124)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:
362)

The RPC method signature in question is:
public void saveContent(String content, String property, List<String>
value) / public void saveContent(String content, String property,
List<String> value, AsyncCallback callback);

I have also attempted making the above signatures specifically accept
ArrayList instead of List but this has not helped. The above
signatures seemingly operated fine in a non OSGi environment.

I believe this may be caused by one of the following and I was hoping
to get some help from someone more familiar with the internals.
1. The GWT source code I am working from at
http://www.google.com/codesearch?hl=en&q=+package:http://google-web-toolkit.googlecode.com/svn+RPC+show:1Inn03YDPh8:hVsyMz8Y-S8:1Inn03YDPh8&sa=N&cd=1&ct=rc&cs_p=http://google-web-toolkit.googlecode.com/svn&cs_f=trunk/user/src/com/google/gwt/user/server/rpc/RPC.java
is not the 1.5 code base, if so this is likely to be my major issue,
could someone kindly point me the correct direction

2. My creation of a ServerSerializationStreamReader in my re-
implemented RPC class (essentially a copy paste of the natively
supplied code with minor changes) is being passed an incorrect
classloader object hence calls like this:
SerializabilityUtil.getSerializationSignature(instanceClass); are
returning incorrect values

3. OSGi containers always supply java.* from a specific classloader
different to the current bundle which essentially ends up being the
same situation as 2 above

4. Something i am just not smart enough to figure out (likely :P).

Any assistance greatly appreciated.

beddoes

unread,
Jun 3, 2008, 6:22:05 PM6/3/08
to Google Web Toolkit
Apologies to the group for the duplicates I was having issues with
posts over 5 or more hours not showing up, turns out I was moderated
due to an issue with the groups software

- Bradley

beddoes

unread,
Jun 3, 2008, 11:23:40 PM6/3/08
to Google Web Toolkit
Further investigation confirms that the function:

private void validateTypeVersions(Class<?> instanceClass,
SerializedInstanceReference serializedInstRef)

Is absolutely giving me different values for:

clientTypeSignature - 3821976829
serverTypeSignature - 3047670833

When attempting to compute for an ArrayList.

Any ideas how I can go about determining if its the input that is the
issue or if the server side function getSerializationSignature() is
calculating incorrectly?.

Bradley

beddoes

unread,
Jun 4, 2008, 11:04:17 AM6/4/08
to Google Web Toolkit
So for anyone finding this in the future.... This ended up being
purely classloader related as expected, i've self implemented similar
to that provided by http://code.google.com/p/google-web-toolkit/issues/detail?id=1888
until this patch shows up in the next release.

Bradley

Tom Davies

unread,
Jun 30, 2008, 10:26:32 PM6/30/08
to Google Web Toolkit
I'm having the same problem, again in an OSGi context, although I'm
having the problem in the reverse direction -- an RPC call returning
an ArrayList to the client.

Looking at the GWT code, I don't understand how this can be a class
loader problem -- the calculation of the signature just relies on
class names, field names, and field types, which shouldn't change as a
function of the class loader.

What am I missing?

Thanks,
Tom
Reply all
Reply to author
Forward
0 new messages