When using GWT I get following warning:
Referencing deprecated class 'com.google.gwt.user.client.rpc.SerializableException'
While it's only a warning, it's dead annoying having to look at every single time I run the project.
The warning occours since my RPC throws java.lang.Exception, and thus never actually uses the SerializableException, but GWT isn't clever enough to figure that out.
Is there a option to turn off the warning, or fix this, besides compiling my own version of the gwt-user/gwt-servlet libraries?
Thanks.
Edit: To clarify, this is GWT 2.0, and the project is being run from the Google Plugin in Eclipse.
Someone on the GWT's Google Group suggested using SerializationException instead of just Exception. Although, the javadocs for SerializableException suggest that Exception should be fine too :/ Which version of GWT are you using?
Deprecated. As of GWT 1.5, Exception implements Serializable and can be used in place of this [SerializableException] class
Lombardi's blog has a discussion of why exactly this is happening in the source.
Yeah, it's silly for Google to claim throwing Exception is a fine thing to do when it generates a lot of unnecessary JavaScript for subclasses of Exception and, in your case, generates warnings about those subclasses.
But this is all the more reason to throw a more specific exception (one that doesn't have a deprecated descendant). Unchecked exceptions on your RPC can still be handled by an UncaughtExceptionHandler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With