【发布时间】:2011-08-30 19:24:48
【问题描述】:
我已经读到了:
但没有解决办法。
我的包裹是:
包 gwt.web 包 gwt.web.client; 等等……
我有包模型
我的班级“models.Word”在哪里
如您所见,该类不位于 int gwt.cleint,但它不应该存在,它不是客户端类。
这个类有默认构造函数,所以这不是问题。
我有例外:
服务方法'public abstract java.util.List gwt.web.client.WordService.getWords(java.lang.String)' 抛出了一个 意外异常: com.google.gwt.user.client.rpc.SerializationException:类型 'models.Word' 未包含在可以使用的类型集中 此 SerializationPolicy 或其 Class 对象无法序列化 被加载。出于安全目的,此类型不会被序列化。: 实例 = Word[null]
在我的 App.gwt.xml 中:
<!-- Specify the paths for translatable code -->
<source path='models'/>
所以这指向我的班级。所以,这也不应该是问题。
问题:如何处理?我需要使用我的模型类通过服务通过 ajax 传递它。
My Class 是可序列化的(实现该接口)。
这个类是我的代码的一部分。 RPC中使用的这个类:
@RemoteServiceRelativePath("wordServiceImpl")
public interface WordService extends RemoteService {
public List<Word> getWords(String langCode);
}
【问题讨论】: