0

我目前正在尝试使用 SyncProxy 库来测试我的应用程序的服务,以便使用 JMeter 进行负载测试。该应用程序运行良好,我在本地主机上运行它。

我已经设法打了一些电话,但只有当参数

这是错误:

类型 '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() {
   }
   ...
}

但实际上,我Utilisateur在 gwt.rpc 文件中看不到该类的任何内容。

4

2 回答 2

0

我认为你需要实施

com.google.gwt.user.client.rpc.IsSerializable

你的课就像:

public class Utilisateur implements IsSerializable, Serializable {
   ...
   public Utilisateur() {
   }
   ...
}
于 2017-05-31T11:22:18.383 回答
0

确保这个类的所有属性也被序列化。

于 2017-06-06T03:19:15.653 回答