在 GWT 开发模式下运行时出现 com.google.gwt.user.client.rpc.SerializationException
当我们在 GWT 开发模式下运行应用程序时,我们会遇到如下所示的序列化异常,如果我们从开发模式之外运行,则不会出现这些异常。有什么想法吗?请注意,有问题的类 MySDO 扩展自 com.extjs.gxt.ui.client.data.BaseModel,它本身是可序列化的。还有一个公共无参数构造函数
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'com.foo.MySDO' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer.For security purposes, this type will not be serialized.: instance = com.foo.MySDO@fd4410
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:610) [:]
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129) [:]
at com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.serialize(Collection_CustomFieldSerializerBase.java:43) [:]
at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serialize(ArrayList_CustomFieldSerializer.java:36) [:]
When we run our application in GWT Dev Mode, we are getting serialization exceptions as shown below that we do not get if we run from outside of dev mode. Any ideas? Please note that the class MySDO in question extends from com.extjs.gxt.ui.client.data.BaseModel which is itself serializable & also has a public no parameter contructor
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'com.foo.MySDO' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer.For security purposes, this type will not be serialized.: instance = com.foo.MySDO@fd4410
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:610) [:]
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129) [:]
at com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.serialize(Collection_CustomFieldSerializerBase.java:43) [:]
at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serialize(ArrayList_CustomFieldSerializer.java:36) [:]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能 com.foo.MySDO 包含一些其他不可序列化的类型
May be com.foo.MySDO include some other not serialiseble type