GWT keeps track of a set of types which can be serialized and sent to the client. your.class.Type apparently was not on this list. Lists like this are stored in .gwt.rpc files. These lists are generated, so editing these lists is probably useless. How these lists are generated is a bit unclear, but you can try the following things:
- Make sure
your.class.Typeimplementsjava.io.Serializable - Make sure
your.class.Typehas a public no-args constructor -
Make sure the members of
your.class.Typedo the same -
Check if your program does not contain collections of a non-serializable type, e.g.
ArrayList<Object>. If such a collection containsyour.class.Typeand is serialized, this error will occur. -
Make
your.class.TypeimplementIsSerializable. This marker interface was specifically meant for classes that should be sent to the client. This didn’t work for me, but my class also implementedSerializable, so maybe both interfaces don’t work well together. -
Another option is to create a dummy class with
your.class.Typeas a member, and add a method to your RPC interface that gets and returns the dummy. This forces the GWT compiler to add the dummy class and its members to the serialization whitelist.