Zakum
Zakum

Reputation: 2287

Failure at loading GWT library

I am trying to deploy a bigger GWT project to start working on it. After several problems I finally ran into the following, which I am not able to solve:

Here is a random piece of code:

service.getSuggestionOracle(this.suggestionString.getText(), new AsyncCallback<List<Entity>>() {
   @Override
   public void onSuccess(List<Entity> result) {
      suggestionString.setStyleName("searchInput");
      processSuggestionOracle(result);
   }

   @Override
   public void onFailure(Throwable caught) {
      suggestionString.setStyleName("searchInput");
      GWT.log("Suggestion fails.");
   }
});

Eclipse complains about the two functions onSuccess and onFailure that:

The method onSuccess(List<Entity>) of type new AsyncCallback<List<Entity>>(){} must override a superclass method

Indeed when I hover over the: new AsyncCallback<List<Entity>>() statement, it tells me that If an RPC is successful, then onSuccess(Object) is called, otherwise onFailure(Throwable) is called.

I conclude that there IS a superclasses with declarations for onSuccess and onFailure, but the compiler doesn't find it.

I use GWT-2.4.0 and the GWT library is added to the classpath.

The code above is just a random example, there are about 150 similar errors all over the project. Additionally, there are several imports like com.xind.gwt.dom.client.DOM, that can not be resolved.

Does anybody have an idea what I am missing here?

Upvotes: 0

Views: 144

Answers (1)

Ashok
Ashok

Reputation: 1952

There are two possibilities that I could think of:

  1. you haven't extended RemoteServiceServlet on the server implementation.

  2. or In this code,

public void onSuccess(List result) {

}

you have List as the returned object. Is this a list of objects of a user-defined class or java datatype? If the list is a user-defined type, then you must serialize the corresponding class by implementing java.io.serializable;

Upvotes: 1

Related Questions