Sep 16

Ever seen this error:
com.google.gwt.user.client.rpc.SerializationException: Type ‘your.class.Type’ was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.

Or this error:
Error: Type ‘your.class.Type’ was not serializable and has no concrete serializable subtypes

It can be caused by multiple reasons, but if you feel like you have done everything correctly (included source in GWT’s classpath during compilation, implement Serializable, google searched, prayed to the god of your choice) then you probably have the problem I had.  your.class.Type doesn’t have a default constructor.

So if your class has no default constructor (one that takes no arguments), add it and try again.  If that doesn’t fix it, and you find out what else is wrong, please post it as a comment here.

Also as an added bonus tip, when google searching for errors, your error usually is of the pattern: “something common to all errors of this type” “something specific to my project” “some more common stuff”.  Like in this error you have common stuff:
com.google.gwt.user.client.rpc.SerializationException: Type

Then specific stuff: 
‘your.class.Type’

Then more common stuff:
was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.

The way to search for that is take your stuff and replace it with an asterisk (*) and put the whole thing in quotes and google will wildcard your specific stuff and you will get better results.  So a good way to search for this error would be (trimming because google only lets you search 32 words):
com.google.gwt.user.client.rpc.SerializationException: Type * was not included in the set of types which can be serialized by this SerializationPolicy”

Hope either of those things help someone.