How to solve GWT compiler error of '[ERROR] The Ginjector xxx does not have a get() method returning'

How to solve GWT compiler error of ‘[ERROR] The Ginjector xxx does not have a get() method returning’

If you get a GWT compiler error of something like:
gwt does not have a get() method returning
See below for exact details. Here is how to fix it:

Also, ensure provider (as defined in your xxx.client.gin MyGinjector presenter (ie. Provider getMainPagePresenter();
HomePresenter.java class) has proxy defined as @ProxyStandard not @ProxyCodeSplit

public static final String nameToken = “main”;
private final DispatchAsync dispatcher;
private PlaceManager placeManager;

@ProxyStandard <-- should not be @ProxyCodeSplit
@NameToken(nameToken)
public interface MyProxy extends Proxy, Place {
}

All other presenters shuold have @ProxyCodeSplit like:

public class Contribute1Presenter extends
Presenter {

public static final String nameToken = “contribute1″;

private final PlaceManager placeManager;

@ProxyCodeSplit
@NameToken(nameToken)
public interface MyProxy extends Proxy, Place {
}

during gwt compiler exception, if you get the following:

Compiling module com.google.musicstore.Siloverse1
Scanning for additional dependencies: generated://760956920BB2959A003B9A3F7AC8B56B/com/google/musicstore/client/gin/MyGinjectorImpl.java
Computing all possible rebind results for ‘com.google.musicstore.client.presenter.Contribute1Presenter.MyProxy’
Rebinding com.google.musicstore.client.presenter.Contribute1Presenter.MyProxy
Invoking com.google.gwt.dev.javac.StandardGeneratorContext@18cc39e
[ERROR] The Ginjector ‘com.google.musicstore.client.gin.MyGinjector’ does not have a get() method returning ‘Provider‘. This is required when using @ProxyStandard.
Computing all possible rebind results for ‘com.google.musicstore.client.presenter.HomePresenter.MyProxy’
Rebinding com.google.musicstore.client.presenter.HomePresenter.MyProxy
Invoking com.google.gwt.dev.javac.StandardGeneratorContext@18cc39e
[ERROR] The Ginjector ‘com.google.musicstore.client.gin.MyGinjector’ does not have a get() method returning ‘AsyncProvider‘. This is required when using @ProxyCodeSplit.
[WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
[WARN] com.google.musicstore.client.presenter.HomePresenterMyProxyImpl
[WARN] com.google.musicstore.client.presenter.Contribute1PresenterMyProxyImpl
[ERROR] Errors in ‘generated://760956920BB2959A003B9A3F7AC8B56B/com/google/musicstore/client/gin/MyGinjectorImpl.java’
[ERROR] Line 253: Failed to resolve ‘com.google.musicstore.client.presenter.Contribute1Presenter.MyProxy’ via deferred binding
[ERROR] Line 291: Failed to resolve ‘com.google.musicstore.client.presenter.HomePresenter.MyProxy’ via deferred binding
[ERROR] Cannot proceed due to previous errors

This can be caused by conflicts if the nameToken is duplicate in any presenters

Also defined in MyPlaceManager:

package com.google.musicstore.client.place;

import com.google.inject.Inject;
import com.google.musicstore.client.presenter.Contribute1Presenter;
import com.google.musicstore.client.presenter.HomePresenter;
import com.gwtplatform.mvp.client.EventBus;
import com.gwtplatform.mvp.client.proxy.PlaceManagerImpl;
import com.gwtplatform.mvp.client.proxy.PlaceRequest;
import com.gwtplatform.mvp.client.proxy.TokenFormatter;

public class MyPlaceManager extends PlaceManagerImpl {

@Inject
public MyPlaceManager(EventBus eventBus, TokenFormatter tokenFormatter) {
super(eventBus, tokenFormatter);
}

@Override
public void revealDefaultPlace() {
// “main”
revealPlace(new PlaceRequest(HomePresenter.nameToken));
//revealPlace(new PlaceRequest(Contribute1Presenter.nameToken));
}

Leave A Response


*

* Denotes Required Field