Weird problem, when i inject EventBus e got an exception. The project is gwt using mvp
Here is the sample code.
Gin
public interface AppGinjector extends Ginjector
{
EventBus getEventBus();
PlaceManager getPlaceManager();
}
Here is the entry point
public class MvpEntryPoint implements EntryPoint
{
AppGinjector ginjector = GWT.create(AppGinjector.class);
public void onModuleLoad()
{
EventBus eventBus = ginjector.geEventBus();
HelloWorldPanel display = new HelloWorldPanel();
HelloWorldPresenter presenter = new HelloWorldPresenter( display, eventBus );
presenter.bind();
RootPanel.get().add( presenter.getDisplay().asWidget() );
PlaceManager placeManager = ginjector.getPlaceManager();
placeManager.fireCurrentPlace();
}
i use gin 1.0 , gwt-presenter
Any has any idea?
Thanks
Edit:
The exception is
ERROR: Deferred binding result type 'net.customware.gwt.presenter.client.EventBus' should not be abstract.
ERROR: Unable to load module entry point class com.gmgsys.mvpEntryPoint.client.MvpEntryPoint (see associated exception for details). java.lang.RuntimeException: Deferred binding failed for 'net.customware.gwt.presenter.client.EventBus' (did you forget to inherit a required module?)
...........................
also the gwt.xml
<!-- Specify the app entry point class. -->
<entry-point class='com.gmgsys.mvpEntryPoint.client.MvpEntryPoint'/>
<inherits name='net.customware.gwt.presenter.Presenter' />
<inherits name="com.google.gwt.inject.Inject" />
I think you are missing the AbstractPresenterModule class which makes sure that EventBus is bound to SimpleEventBus:
It should be something like that:
And you have to annotate your Ginjector