每个人!我的 GWT 应用程序存在编译问题,该应用程序分为 3 个模块:App-core:包含没有入口点的主类,App-A 和 App-B:从 App-core 继承,并包含特定类在每个子模块中都有一个入口点。
我正在使用 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 中做同样的事情
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 的绑定,但我们只有一个子模块有这个编译错误。所以如果有人遇到这个问题之王,我正在等待他的宝贵帮助^^
啊! 如果你想要一些精度,不要害羞!