Monday, May 3, 2010

GWT SerializationException


com.google.gwt.user.client.rpc.SerializationException:

Okay this is really a beginners mistake. I was getting a SerializationException today with a GWT RPC call. Remember to make sure that all classes implement Serializable and that the classes all have the default constructors defined as is required by Java serialization.

If you like defining your classes with useful constructors the provide a way of getting the data into the object then a good approach is to make the default constructor private and suppress the unused warnings.



@SuppressWarnings("unused")
private MyClass(){}



This is one of the first attempts at documenting a problem and solution in my blog as an ongoing effort to develop a solutions log. I may need to come back later with some code examples but I want to continue on for now.

No comments: