开发者

GWT: Could not locate RequestContext method

开发者 https://www.devze.com 2023-03-04 08:33 出处:网络
I have public interface MyRequestFactory extends RequestFactory { @Service(Client.class) public interface ClientRequest extends RequestContext {

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

精彩评论

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