I just had to debug one of these errors.

I just set a break point where the exception is raised (i.e.
SerializerBase.java:161).  I ran my app in debug developer mode and
when I hit the breakpoint I was able to inspect the parent call in the
stack where there is a method parameter called "instance".  This will
hopefully highlight the offending class where you should make sure it
follows Sri's previous recommendations.

I mostly get these errors where the RPC call is given a class which is
itself OK but has had a non-serialisable payload assigned to it
somewhere (e.g. as part of a Command pattern).  So, I'm not sure that
much can be done by the compiler to raise such conditions.  As a quick
method of getting the compiler to flag up possible RPC errors, I
modified the payloads for the offending commands to avoid vague types
like "Object" and instead used "Serializable".  (I'd normally avoid
using Object but I'd inherited the code ;)

You're right though - the exception message for this error case is
unhelpful and should at least additionally use information from the
serialisation target instance where RPC type information is not
available.

Cheers,

Chris.


On May 31, 3:53 pm, svincent <[email protected]> wrote:
> Greetings,
>
> I'm having a frustrating time debugging a bunch of code I'm trying to
> port to GWT.  There are various subtle serialization issues (not
> surprising, since GWT has its special rules).
>
> The real problem I'm running in to is that the exception I keep
> getting is this:
>
> com.google.gwt.user.client.rpc.SerializationException: null
>     at
> com.google.gwt.user.client.rpc.impl.SerializerBase.check(SerializerBase.jav a:
> 161)
>     at
> com.google.gwt.user.client.rpc.impl.SerializerBase.serialize(SerializerBase 
> .java:
> 145)
>     at
> com.google.gwt.user.client.rpc.impl.ClientSerializationStreamWriter.seriali 
> ze(ClientSerializationStreamWriter.java:
> 199)
> ...
>
> This exception is terrible: it doesn't tell me what class is having
> the trouble.  It tries to print out the 'typeSignature', but the
> typeSignature is null for classes with certain types of serialization
> issues.
>
> A couple of thoughts:
>
> 1. it would be Really Nice if GWT could be changed to fix this
> exception to be more meaningful (at least include the class name
> that's having the trouble)
>
> 2. Does anybody have tips on what to do when you get this exception?
> I've encountered one case: don't have fields of type java.lang.Object
> in your GWT Serializable classes.  Is there more?
>
> Thanks!
>     -Shawn.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to