0
votes

In GWT application I have RPC interface. Some methods works fine (i.e. RemoeServiceServlet configured fine), but when I try to invoke another method, it always fails with onFailure() method. Ajax call also don't occur (I can see it using FireBug, also on server side method invocation don't occur), but another methods of this service performs Ajax calls as well.

When I try to log error using e.getMessage() I get "undefined" message. Also I tried to wrap RPC calling code using try-catch - no error message.

Can this issue be related with GWT-RPC Serialization?

EDIT: Opera Dragonfly showed error on following method inside generated JavaScript (compiled with PRETTY mode):

function $check(this$static, typeSignature){ if (isNull($get_3(this$static.methodMapNative, typeSignature))) { Unhandled Object: undefined throw new SerializationException_1(typeSignature); } }

with error message

Unhandled Object: undefined

1
which gwt version u are using ? - Saddam Abu Ghaida
@RAS when compiling I get a waring for field with type Serializable. But I used as well Serializable fields in another project, so problem not related with it. - MyTitle
@SaddamAbuGhaida I use GWT 2.4 - MyTitle
This type of problem doesn't occur at compile time. At run time, check your console as well as development mode just before you're reaching upto onFailure(). There must be some warning that can lead us. - RAS
@RAS thanks, now I get error message. Please, review edited answer. - MyTitle

1 Answers

1
votes

I would guess that you have a Serialization issue, remember that Java Serialization is not the same as GWT Serialization.

There is often no meaningful error message on Serialization errors when using RPC.

  • must have 0-ary constructor
  • final fields are inherently transient (ie. do NOT use final fields in classes intended to be serialized)
  • collections (ex List and Set) must be annotated with @gwt.typeArgs. @gwt.typeArgs is a JavaDoc annotation, thus it must be wrapped in a JavaDoc comment ex.: /** @gwt.typeArgs */

For more details see: GWT Serialization

Another thing to try: When running GWT from the eclipse-plugin, a folder in the eclipse project is created (I belive its called gwt-unitCache). Sometimes my own GWT projects get ill and output strange exceptions, I can solve this by deleting the folder and run the project again.