详细信息:我认为我从 rpc 返回了无效的对象列表。我认为它的类型不能被序列化..有人知道序列化它的方法吗?或一些解决方法?
我有一个无法序列化的类我收到以下异常:
原因: "com.google.gwt.user.client.rpc.SerializationException: Type 'gwt.client.objects.NamedObject' 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.: instance = gwt.client.objects.NamedObject@613bc2a6"
这是“NamedObject”类源代码,我将返回一个列表。
public class NamedObject<T> implements Serializable {
private String name;
private T object;
public void setNamedObject(String name, T object){
setName(name);
setObject(object);
}
public String getName() {
return name;
}
public Object getObject() {
return object;
}
}