java.lang.RuntimeException: GWT 中的延迟绑定错误

java.lang.RuntimeException: Deferred binding error in GWT

我正在学习 here 的教程。 我试图从我的模块进行 RPC 调用。但是我收到了这个错误。

java.lang.RuntimeException: Deferred binding failed for 'myPackageName.client.StockPriceService' (did you forget to inherit a required module?)

我的 StockPriceService class 是:

@RemoteServiceRelativePath("stockPrices")
public interface StockPriceService extends RemoteService{

    StockPrice[] getPrices(String[] symbols) throws DelistedException;
}

StockPriceServiceAsync class 是:

public interface StockPriceServiceAsync {

    void getPrices(String[] symbols, AsyncCallback<StockPrice[]> callback); 
}

我的股票价格 class 是:

public class StockPrice implements Serializable{

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String symbol;
    private double price;
    private double change;

    public String getSymbol() {
        return symbol;
    }

    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getChange() {
        return change;
    }

    public void setChange(double change) {
        this.change = change;
    }

    public double getChangePercent() {
        return 100.0 * this.change / this.price;
    }

    public StockPrice(String symbol, double price, double change) {
        super();
        this.symbol = symbol;
        this.price = price;
        this.change = change;
    }
}

在我的 EntryPoint 中执行以下行时,我总是收到错误 Class

private StockPriceServiceAsync stockPriceSvc = GWT.create(StockPriceService.class);

感谢任何形式的帮助。

StockPrice 必须有一个零参数构造函数或根本没有构造函数用于默认启动。请检查堆栈跟踪并确认。