Thursday, February 21, 2013

Re: IncompatibleRemoteServiceException : The response can not be Deserialized

Well, seems things are quite odd. First, Tried all the suggestions:
  • Now on newer GWTP v0.8.4
  • Confirmed only gwt-servlet-2.5.0.jar present
  • Confirmed that mvn (single prop is used) loads all GWT dependencies as 2.5.0
  • Tested on Java6, Java7
Note: on Ubuntu 12.10, OpenJDK 6/7

But here is the interesting part. The exception is being thrown on line 153 of SerializerBase

  private TypeHandler getTypeHandler(String typeSignature)        throws SerializationException {      String typeHandlerClass = methodMapJava.get(typeSignature); //<<< returns NULL        if (typeHandlerClass == null) {       /*        * Probably trying to serialize a type that isn't supposed to be        * serializable.        */        throw new SerializationException(typeSignature);      }

The request payload: 7|1|4|http://127.0.0.1:8888/main/|136A4F582E1FABB50338F54C89DA7F0C|_|getDouble|1|2|3|4|0|
The response: //OK[0.44995762496622327,1,["java.lang.Double/858496421"],0,7]

The value of typeSignature: java.lang.Double/858496421

But methodMapJava has the following entries
  • 3=com.google.gwt.user.client.rpc.XsrfToken_FieldSerializer,
  • 2=com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer,
  • 1=com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer,
  • 4=com.google.gwt.user.client.rpc.core.java.lang.Double_FieldSerializer,
  • 8=com.google.gwt.user.client.rpc.core.java.lang.String_FieldSerializer
This looks totally incorrect. The keys are numeric (strings) in the map, but the passed signature is just that, a signature. So it seems the map is being populated incorrectly, or the signature sent is bonk.

So I'm left wondering why everything compiles without an issue (string mode on) while it seems like the serializers are not correct.


Sincerely,
Joseph

P.S. The fact that primitives work is explained because all primitives have hardcoded deserializers in RequestCallbackAdapter. Thus they don't do any such map lookup.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment