开发者

GWT: Could not locate RequestContext method

I have

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();            
  }
}

I am calling the method with

    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() );
      开发者_如何学Python          }
                @Override
                public void onFailure(ServerFailure error) {
                    Window.alert( error.getMessage() );
                }                   
            }
    );      

I am getting

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

What is wrong?


I made the class Client Serializable and added an empty constructor:

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

    public Client() {
    }
...

Now it is working.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜