4
每一个! 我在我的GWT应用程序中有一个编译问题,它分为3个模块: App-core:包含没有入口点的主类, App-A和App-B:从App-core继承,并包含在每个子模块中都有具有入口点的特定类。GWTP应用程序中的GIN绑定问题
我使用的是GIN每个模块中注入的类的实例:
在应用核:
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中的东西
maven编译对于App-A来说是成功的,但是对于App-B却是失败的, essage:
[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
那么怪异的一部分INT这一切的是,这个错误来自这两个子模块之间共享的模块,女巫是LoginPagePresenter和AuthentificationManager的结合,但我们只是在一本汇编错误子模块。 所以如果有人有这个国王的问题,我等待他的宝贵帮助^^
啊!如果你想要一些精确度,不要害羞!
的几个问题(这是无需强硬所有代码来看看,GWTP有很多文件,它打破了这一切),你是什么导入的EventBus,它是com.google.gwt.event.shared.EventBus?另外你的PlaceManager实现应该继承PlaceManagerImpl的子类。如果你能捆绑代码,我应该能够为你解决这个问题,但是很多问题可能会出错,并且知道从哪里开始寻找什么是不容易的。我采用的方法是简化,首先删除除EventBus和PlaceManager之外的所有内容,然后查看是否可以获取 – 2012-07-05 11:58:07