【发布时间】:2017-10-31 05:10:08
【问题描述】:
我目前正在尝试使用 SyncProxy 库来测试我的应用程序的服务,以便使用 JMeter 进行负载测试。该应用程序运行良好,我在 localhost 上运行它。
我已经设法进行了一些调用,但只有当参数在哪里时
这是错误:
类型“net.gicm.ector.shared.beans.Utilisateur”未包含在 可以通过此 SerializationPolicy 序列化的类型集或 无法加载其 Class 对象。出于安全目的,此类型 不会被序列化。
这是我拨打电话的一段代码:
final Utilisateur user = new Utilisateur();
user.setUser("C2984");
TableauDeBordServiceAsync tableauDeBordServiceAsync = (TableauDeBordServiceAsync) SyncProxy
.newProxyInstance(TableauDeBordServiceAsync.class, MODULE_BASE_URL, GET_SERVICE_NAME_2);
tableauDeBordServiceAsync.ongletRealisationListeControle(plan, user, codeSI, numStructure, synthese, colonneAtrier, ordre, numeroPagination, filtre, new AsyncCallback<List<List<String>>>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
System.out.println(caught);
}
@Override
public void onSuccess(List<List<String>> result) {
// TODO Auto-generated method stub
System.out.println(result);
}
});
我查看了这个帖子,并试图找出我哪里做错了:https://stackoverflow.com/a/9534704/4628136
我的类实现了Serializable 接口,有一个默认的空构造函数,并且在客户端包中。
public class Utilisateur implements Serializable {
...
public Utilisateur() {
}
...
}
但实际上,我在 gwt.rpc 文件中没有看到关于 Utilisateur 类的任何内容。
【问题讨论】:
-
如果
Utilisateur聚合了不可序列化/无参数构造函数的类型,也会出现该错误。 -
嗯,只有一个,它确实有一个无参数的构造函数,它实现了 Serializable 接口
-
Utilisateur 中的课程是否在“共享”数据包中?
-
是的,它在“共享”包中
-
请不要在 Stack Overflow 上发布像 paste.ofcode.org 这样的临时内容。
标签: java gwt gwt-rpc gwt-syncproxy