Thursday, September 1, 2011

Re: Inherited exceptions in GWT-RPC

On Thursday, August 25, 2011 3:09:22 PM UTC-5, Ryan wrote:
However, if I declare AException in the client, but throw either of
the two child classes in the server, GWT wraps it in an
InvocationException.

This is the key to your issue - if the client can't de-serialize it (because the code only exists where the server can see it, not the client), it can't allow it to be thrown to the client.

Unless I've misunderstood, and all three are declared in the client package, but only AException is declared as part of the RPC method signature. If that is the case, this should work as you expect. A few other things could B, C from being available to be deserialized, such as being blacklisted in your module file, or not having default (i.e. no-arg) constructors, things that would affect any other DTO expected to work with RPC.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ChCwhoWXaeoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment