SerializationException: type not included in serializable type set

前端 未结 6 1897
既然无缘
既然无缘 2021-01-07 17:14

In my Google Web Toolkit project, I got the following error:

com.google.gwt.user.client.rpc.SerializationException: Type ‘your.class.Type’ was not included in the se

6条回答
  •  礼貌的吻别
    2021-01-07 17:40

    I had the same issue in a RemoteService like this

    public List getX(...);
    

    where X is an interface. The only implementation did conform to the rules, i.e. implements Serializable or IsSerializable, has a default constructor, and all its (non-transient and non-final) fields follow those rules as well.

    But I kept getting that SerializationException until I changed the result type from List to X[], so

    public X[] getX(...);
    

    worked. Interestingly, the only argument being a List, Y being an interface, was no problem at all...

提交回复
热议问题