I am getting com.google.gwt.user.client.rpc.SerializationException exception for HashSet.
Initially I thought either HashSet of Long is not supported.
But https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation contains both of these.
What would be the problem?
I am posting the Service method here:
public Set<Long> getNamesFromIDs(Set<Long> ids) {
return manager.getNamesFromIDs(ids);
}
Here, manager is the reference to the Manager class which is included from a library.
I am posting the manager method too:
public Set<Long> getNamesFromIDs(Set<Long> styleIds) {
List<Long> listIDs = new ArrayList<Long>(styleIds);
Map<Long, Discount> personMap = personDAO.getStyleIdToDiscountMap(listIDs, 0);
return personMap.keySet();
}
Detailed Exception Message:
com.google.gwt.user.client.rpc.SerializationException: Type 'java.util.HashMap$KeySet'
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 = [30002, 30001]
The above classes from java.util are serialized by the custom field serializer.
Serialization for the KeySet is not supported by GWT. It does not implement a Serializable interface ( so it is not serializable in java world either)