GWTP应用程序中的GIN绑定问题

每一个人!

我的GWT应用程序中存在编译问题,该应用程序分为3个模块:

App-core:包含没有入口点的主类,

App-A和App-B:从App-core继承,并包含每个子模块中具有入口点的特定类.

我正在使用GIN在每个模块中注入类实例:

在App-core中:

public interface App-coreGinjector extends Ginjector {
EventBus getEventBus();
Provider<LoginPagePresenter> getLoginPagePresenter();
...
}

App-coreModule extends AbstractPresenterModule {

protected void configureCore() {
    install(new DefaultModule(App-corePlaceManager.class));
    bindConstant().annotatedWith(DefaultPlace.class).to(LoginPagePresenter.NAME_TOKEN);
    ...
    bind(AuthenticationManager.class).to(AuthenticationManagerImpl.class);
    bindPresenter(LoginPagePresenter.class, LoginPagePresenter.MyView.class,
                  LoginPageView.class, LoginPagePresenter.MyProxy.class);
 }

在App-A中:

@GinModules({ App-AModule.class })
public interface App-AGinjector extends App-coreGinjector {

MyApp-AScreen getMyApp-AScreen();
...
}

public class App-AModule extends App-coreModule {

@Override
protected void configure() {

    configureCore();
            ...
            //Here we bind the App-A classes inheriting from App-core classes 
            bind(App-coreScreenManager.class).to(App-AcreenManager.class).in(Singleton.class);
            ...
            //Here we bind the specific App=A classes
    }

我们在App-B中做同样的事情

App-A的maven编译成功,但App-B失败,显示以下消息:

[ERROR] Errors in 'C:\workspace\App-core\client\gin\App-coreGinjectorImpl.java'
[ERROR] Line 790:  Rebind result 'com.gwtplatform.mvp.client.proxy.PlaceManager' must be a class
[ERROR] Line 818:  Rebind result 'lu.sfeir.grh.client.authentication.AuthenticationManager' must   be a class
[ERROR] Line 1047:  Rebind result 'lu.sfeir.grh.client.login.LoginPagePresenter.MyView' must be a class
[ERROR] Line 2359:  Rebind result 'com.google.gwt.event.shared.EventBus' cannot be abstract
[ERROR] Cannot proceed due to previous errors

所以这个奇怪的部分是这个错误来自这两个子模块之间的共享模块,这是LoginPagePresenter和AuthentificationManager的绑定,但我们只在一个子模块中有这个编译错误.
因此,如果有人有这个问题的王者,我正在等待他的宝贵帮助^^

啊!如果你想要一些精确,不要害羞!

最佳答案 在GWTP 0.7中,所有EventBus实例都从中更改

    com.google.gwt.event.shared.EventBus;
    to 
    com.google.web.bindery.event.shared.EventBus

如果你使用的是GWTP 0.6,你必须将它们改回来……

点赞