GWT:找不到RequestContext方法

时间:2011-05-11 13:10:39

标签: java gwt

我有

public interface MyRequestFactory extends RequestFactory {
  @Service(Client.class)
  public interface ClientRequest extends RequestContext {
      Request<List<ClientProxy>> getClients();
      Request<ClientProxy> findClient(int id);
      InstanceRequest<ClientProxy, Void> persist();
      InstanceRequest<ClientProxy, Void> remove();            
  }
}

我用

调用方法
    MyRequestFactory.ClientRequest request = requests.clientRequest();
    Request<ClientProxy> getReq = request.findClient(clientId);
    getReq.fire(
            new Receiver<ClientProxy>() {
                @Override
                public void onSuccess(ClientProxy response) {
                    display.getBreadCrumpTextBox().setText( response.getBreadcrump() );
                    display.getIntroductionTextArea().setText( response.getIntroduction() );
                }
                @Override
                public void onFailure(ServerFailure error) {
                    Window.alert( error.getMessage() );
                }                   
            }
    );      

我正在

Server Error: Could not locate RequestContext method de.x.y.z.MyRequestFactory$ClientRequest::findClient

有什么问题?

1 个答案:

答案 0 :(得分:0)

我创建了Client Serializable类,并添加了一个空构造函数:

public class Client implements Serializable {
    private static final long serialVersionUID = 5744986706947752922L;

    public Client() {
    }
...

现在它正在运作。