0

ERROR: Error injecting com.avtodoria.tracer.web.client.view.SearchProfileViewImpl$SearchProfileViewUiBinder: Unable to create or inherit binding: No @Inject or default constructor found for com.avtodoria.tracer.web.client.view.SearchProfileViewImpl$SearchProfileViewUiBinder

Generally, this error appears if I forgot to annotate constructor SearchProfileViewImpl with @Inject. But:

...
import com.google.inject.Inject;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.web.bindery.event.shared.EventBus;
...


public class SearchResultViewImpl extends AbstractView implements SearchResultView {

    interface SearchResultViewUiBinder extends UiBinder<FlowPanel, SearchResultViewImpl> {}

@Inject
private EventBus eventBus;

@UiField(provided = true)
CellTable<SearchResultProxy> resultTable;
@UiField(provided = true)
MapWidget mapWidget;
@UiField
SearchResultResources res;
@UiField
Breadcrumbs breadcrumbs;
@UiField
FlowPanel resultPanel;
@UiField
Button collapseButton;
@UiField
NavLink backLink;
@UiField
NavLink currentSearchPatternNavLink;
@UiField
Pager pager;
@UiField
Grid pagerPanel;
@UiField
FlowPanel container;

**@Inject**
public SearchResultViewImpl(SearchResultViewUiBinder uiBinder) {
    prepareResultTable();
    prepareMap();
    initWidget(uiBinder.createAndBindUi(this));
    res.css().ensureInjected();

    pager.setDisplay(resultTable);

    detailsPopup = new SearchResultDetailsPopup(map, DEFAULT_PROJECTION, "resultDetailsPopup", 300, 300);

    bindEvents();
}
...

In the same classes, which use Uibinder too, this error doesn`t appear.

Gin Module:

public class AppModule extends AbstractGinModule {

@Override
protected void configure() {
    bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);

    bind(AppView.class).to(AppViewImpl.class);
    bind(SearchProfileView.class).to(SearchProfileViewImpl.class);
    bind(AreaSelectView.class).to(AreaSelectViewImpl.class);
    bind(SearchResultView.class).to(SearchResultViewImpl.class);
}
...

Also, my colleague work with the same code, but without this error. In addition, this problem only appears, when I ran GWT debug. I tryed to reinstall the whole project and IDE but nothing changed. Help me pls!

PS I apologize for my English, but I hope that the problem is clear.

0 Answers0