gpt4 book ai didi

java - 从 GWT 应用程序中执行 RPC 时出现 SerializationPolicy 错误

转载 作者:IT老高 更新时间:2023-10-28 20:37:00 26 4
gpt4 key购买 nike

我收到以下异常:

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:

  1. 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.
  2. all the class’s non-final, non-transient instance fields are serializable
  3. the class has a public default (zero argument) constructor

关于java - 从 GWT 应用程序中执行 RPC 时出现 SerializationPolicy 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4202964/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com