У меня есть мобильный файл с:
<extend-configuration-property name="gin.ginjector.extensions" value="test.client.gin.ClientInjectorAdditional"/>
Мой ClientInjectorAdditional:
public interface ClientInjectorAdditional extends Ginjector {
NotificationFetcher getNotificationFetcher();
}
Теперь я хочу внедрить NotificationFetcher в свой класс точки входа. Я старался
public class Test implements EntryPoint {
private static final ApplicationController controller = GWT.create(ApplicationController.class);
@Inject
private NotificationFetcher notificationFetcher;
@Override
public void onModuleLoad() {
controller.init(;
...
}
}
Проблема в том, что notificationFetcher не внедряется.
Как использовать GWTP с расширениями ginjector?
Редактировать:
Когда я использую
private final ClientInjectorAdditional injector = GWT.create(ClientInjectorAdditional.class);
Я получаю следующее предупреждение:
No gin modules are annotated on Ginjector interface test.client.gin.ClientInjectorAdditional, did you forget the @GinModules annotation?
Редактировать:
Я старался:
@GinModules({ ClientModule.class }) открытый интерфейс ClientInjectorAdditional расширяет Ginjector { ... }
Но это дает следующую ошибку:
[DEBUG] [test] - Rebinding test.client.gin.ClientInjectorAdditional
[DEBUG] [test] - Invoking generator com.google.gwt.inject.rebind.GinjectorGenerator
[ERROR] [test] - Error injecting com.gwtplatform.dispatch.rest.client.ActionMetadataProvider: Unable to create or inherit binding: No @Inject or default constructor found for com.gwtplatform.dispatch.rest.client.ActionMetadataProvider
Path to required node:
com.gwtplatform.dispatch.rest.client.RestRequestBuilderFactory [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:99)]
-> com.gwtplatform.dispatch.rest.client.DefaultRestRequestBuilderFactory [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:99)]
-> com.gwtplatform.dispatch.rest.client.ActionMetadataProvider [@Inject constructor of com.gwtplatform.dispatch.rest.client.DefaultRestRequestBuilderFactory]
[ERROR] [test] - Error injecting com.gwtplatform.dispatch.rest.client.serialization.JacksonMapperProvider: Unable to create or inherit binding: No @Inject or default constructor found for com.gwtplatform.dispatch.rest.client.serialization.JacksonMapperProvider
Path to required node:
com.gwtplatform.dispatch.rest.client.serialization.Serialization [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:103)]
-> com.gwtplatform.dispatch.rest.client.serialization.JsonSerialization [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:103)]
-> com.gwtplatform.dispatch.rest.client.serialization.JacksonMapperProvider [@Inject constructor of com.gwtplatform.dispatch.rest.client.serialization.JsonSerialization]
[ERROR] [test] - Deferred binding failed for 'test.client.gin.ClientInjectorAdditional'; expect subsequent failures
[ERROR] [test] - Failed to create an instance of 'test.client.test' via deferred binding
[ERROR] [test] - Unable to load module entry point class test.client.test (see associated exception for details)
[ERROR] [test] - Failed to load module 'test' from user agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36' at http-server.fritz.box:61196
No default constructor found for com.gwtplatform.dispatch.rest.client.ActionMetadataProvider
иNo default constructor found for com.gwtplatform.dispatch.rest.client.serialization.JacksonMapperProvider
- person Braj   schedule 22.03.2014<extend-configuration-property name="gin.ginjector.extensions"...
из gwt.xml. ИспользуйтеGWT.create()
- person Braj   schedule 22.03.2014GWT.create()
вместо@Inject
. - person Braj   schedule 22.03.2014