Hi All,
I have created a base library which has the BaseGinjector and
BaseGinModule as listed below:
BaseGinjector.java
[CODE]
public interface BaseGinjector extends Ginjector{
ActivityMapper getActivityMapper();
PlaceController getPlaceController();
EventBus getEventBus();
AppPlaceFactory getAppPlaceFactory();
ApplicationServiceAsync getApplicationService();
PlaceHistoryMapper getPlaceHistoryMapper();
}
[/CODE]
BaseGinModule.java
[CODE]
public class BaseGinModule extends AbstractGinModule{
@Override
protected void configure() {
bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
// Bind the Place Controller
bind(PlaceController.class).to(InjectablePlaceController.class).in(Singleton.class);
// Bind the Application Place History
bind(AppPlaceFactory.class).in(Singleton.class);
// bind the Mapper
bind(ActivityMapper.class).to(AppActivityMapper.class).in(Singleton.class);
bind(PlaceHistoryMapper.class).to(AppPlaceHistoryMapper.class).in(Singleton.class);
}
}
[/CODE]
Now i have many apps which uses the above classes ( I just wanted to
reuse the above configured bindings)..
Now my app Specific Ginjector is
[CODE]
@GinModules(MyAppGinModule.class)
public interface MyAppGinjector extends BaseGinjector{
AppPlaceFactory getAppPlaceFactory();
AppServiceAsync getApplicationService();
CanvasView getCanvasView();
}
[/CODE]
and the app Specific Gin Module.
[CODE]
public class MyAppGinModule extends BaseGinModule{
@Override
protected void configure() {
super.configure();
bind(AppPlaceFactory.class).in(Singleton.class);
bind(AppServiceAsync.class).in(Singleton.class);
// Bind the Views as Singletons.
bind(CanvasView.class).in(Singleton.class);
// Bind the Places..
bind(AppHomePlace.class);
bind(AppSearchPlace.class);
}
}
[/CODE]
When i build the Base app everything works as expected. ( I didn't use
the @GinModules annotation in my base project).
How ever when i build the App Specific POM then i am getting the
following error:
[ERROR]
Scanning for additional dependencies: C:\apps\MyApp\target\.generated
\com\myapp\client\ioc\MyAppGinjectorImpl.java
[INFO] Computing all possible rebind results for
'com.myapp.base.gwt.client.ioc.BaseGinjector'
[INFO] Rebinding com.myapp.base.gwt.client.ioc.EADFGinjector
[INFO] Invoking generator
com.google.gwt.inject.rebind.GinjectorGenerator
[INFO] [ERROR] No @Inject or default constructor found
for class com.google.gwt.place.shared.PlaceController
[INFO] [WARN] For the following type(s), generated source was
never committed (did you forget to call commit()?)
[INFO] [WARN] com.myapp.base.gwt.client.ioc.BaseGinjectorImpl
[INFO] [ERROR] Errors in 'C:\apps\MyApp\target\.generated\com\myapp
\client\ioc\MyAppGinjectorImpl.java'
[INFO] [ERROR] Line 424: Failed to resolve
'com.myapp.base.gwt.client.ioc.BaseGinjector' via deferred binding
[INFO] [ERROR] Cannot proceed due to previous errors
[/ERROR]
Does this mean i cannot extend an existing GinModule ??
If i include the @GinModules annotation for the BaseGinModule then i
am getting duplicate binding error !!
[ERROR] Double-bound: Key[type=com.google.gwt.event.shared.EventBus,
annotation=[none]]
Thanks
sateesh
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.