Tuesday, December 18, 2018

Re: Would a kind soul give me a hint with this error on client side serialization?

I can now answer my own question:

1) compile with "detailed" output script
2) open the page and activate Javascript Developer Tools (in Chrome, F12)
3) put a conditional breakpoint on the like "this$static[signature][2]" with expression
typeof this$static[signature][2] !== "function"

4) execute the remote call.

When debugger stops, check what "instance" variable is holding. This is your problem. Let's say it is the object "MyCustomSerializableClass"

Now, how to solve?

In your service interface, create a method

public MyCustomSerializableClass workaround(MyCustomSerializableClass mc);


In your async service interface, create a method

public void workaround(MyCustomSerializableClass mc, AsyncCallback<MyCustomSerializableClass> asyc);


And add to the my the implementation class

public MyCustomSerializableClass workaround(MyCustomSerializableClass mc) {
 
return new MyCustomSerializableClass();
}



Thats it! Solved... And as bonus, GWT 2.6.1 dev-mode came to life again :-)


Hope this saves someone from trouble - took me 5 days 14 hours each to realize all this stuff (may be I'm just slow :-) )...



Regards,

Edson



Em segunda-feira, 17 de dezembro de 2018 15:33:42 UTC-2, Edson Richter escreveu:
I'm receiving the error "this$static[signature][2] is not a function".
I was able to track this error down to the client code:

SerializerBase.java:


    native void serialize(SerializationStreamWriter stream, Object instance,
       
String signature) throws SerializationException /*-{
      this[signature][2](stream, instance);
    }-*/
;
 
}



What does that means? Would GWT tell me which class is offending the rules? I have literally 250 classes that would be serialized, and could not find the cause.
Also, I'm sure that the client is returning same objects that was send from server (client receives the object, set one BigDecimal value, and return same objects back to server).

Please, give me an advise!

Regards,

Edson

--
You received this message because you are subscribed to the Google Groups "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment