I have a fairly simple case. I have also simplified the names to make it easier to read (see below).
I have an enum and a user-defined class which uses this enum, as well as a String.
According to GWT:
· The enum should be serializable.
· The user-defined class should be serializable because:
o It directly implements Serializable.
o It’s non-final, non-transient instance fields are serializable:
§ The enum is serializable.
§ The String is serializable.
o It has a default (zero argument) constructor.
Despite conforming to these rules, an attempt to use these classes results in the following error:
SEVERE: Exception while dispatching incoming RPC call com.google.gwt.user.client.rpc.SerializationException: Type 'com.arcsight.arcmc.ui.common.service.shared.data.Bar 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 = com.arcsight.arcmc.ui.common.service.shared.data.Bar @4c19cc84
Simple case.
GWT bungles it.
Is it broken?
Paul
A type is serializable and can be used in a service interface if one of the following is true:
A user-defined class is serializable if all of the following apply:
Foo.java
public enum Foo {
A, B, C;
}
Bar.java
public class Bar implements Serializable {
private static final long serialVersionUID = 604131643709466885L;
private Foo foo;
private String s;
public Bar() {
}
public Foo getFoo() {
return foo;
}
public void setFoo(Foo foo) {
this.Foo = foo;
}
public String getS() {
return s;
}
public void setS(String s) {
this.s = s;
}
}