我收到以下异常:
com.google.gwt.user.client.rpc.SerializationException: Type 'java.lang.Long' 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
使用 GWT 2.1 和内置的 Jetty 服务器。根据文档,这种类型绝对是可序列化的......我怎样才能将它包含在 SerializationPolicy 中?
最佳答案
这是应该解决问题的链接: http://developerlife.com/tutorials/?p=131
A user defined class is serializable if:
- the class is assignable to IsSerializable or java.io.Serializable, either because it implements one of these interfaces, or because it is derived from a superclass that implements one of these interfaces.
- all the class’s non-final, non-transient instance fields are serializable
- the class has a public default (zero argument) constructor
关于java - 从 GWT 应用程序中执行 RPC 时出现 SerializationPolicy 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4202964/