Serializing RPC Exceptions

12 views
Skip to first unread message

ssylvis

unread,
Dec 6, 2007, 7:44:32 PM12/6/07
to Google Web Toolkit
I tried to test the behavior of RPC checked exceptions by adding
IllegalArgumentException to my service interface, like so:
String create(Metadata pMetadata) throws IllegalArgumentException;

However, GWT complained that IllegalArgumentException is not
serializable even though it implements the Serializable interface:
[ERROR] Type 'java.lang.IllegalArgumentException' was not serializable
and has no concrete serializable subtypes

After searching the forums, it seems as though exceptions must
implement IsSerializable? With the release of 1.4, I was under the
impression that the Serializable interface could be used as a
replacement for IsSerializable for all RPC objects, not just method
parameters. It seems silly to me that not even the JRE exceptions can
be used as RPC checked exceptions. But maybe I've made a simple
mistake.

江永源

unread,
Dec 6, 2007, 10:39:28 PM12/6/07
to Google Web Toolkit
IllegalArgumentException extends SerializableException implements
IsSerializable

mP

unread,
Dec 6, 2007, 11:12:32 PM12/6/07
to Google Web Toolkit

java.lang.IllegalArgumentException doesnt extend SeralizableException.
The problem is many of the java.lang and java.util emulated types
*dont* implement Serializable etc so arent considered Serializable by
the generator.

The emulated types are the ones that are checked and not the real jdk
ones...


On Dec 7, 2:39 pm, "江永源" <yongyuan.ji...@gmail.com> wrote:
> IllegalArgumentException extends SerializableException implements
> IsSerializable

Arthur Kalmenson

unread,
Dec 7, 2007, 2:12:31 PM12/7/07
to Google Web Toolkit
mP, it implements Serializable though. I already have wrappers for
exceptions like FileNotFoundException and SQLException, but do I need
to make wrappers for IllegalArgumentExpeceptions too?

mP

unread,
Dec 10, 2007, 8:08:20 PM12/10/07
to Google Web Toolkit
On the server ( in a regular jvm) it implements Serializable but does
the emulated IAE implement Serializable ? I have run into similar
problems recently and im pretty sure the emulated IAE doesnt.

Miguel Méndez

unread,
Dec 11, 2007, 10:41:19 AM12/11/07
to Google-We...@googlegroups.com
@ssylvis: The version of Throwable in our JRE emulation does not implement Serializable.  The reason and a potential compromise is desribed in issue 1139, which is still open.
--
Miguel

ssylvis

unread,
Dec 19, 2007, 7:10:02 PM12/19/07
to Google Web Toolkit
Ah, thanks for the reference. I'll add a vote for the resolution of
this issue. :)

On Dec 11, 7:41 am, "Miguel Méndez" <mmen...@google.com> wrote:
> @ssylvis: The version of Throwable in our JRE emulation does not implement
> Serializable. The reason and a potential compromise is desribed in issue
> 1139 <http://code.google.com/p/google-web-toolkit/issues/detail?id=1139>,
> which is still open.
Reply all
Reply to author
Forward
0 new messages