Guice configuration error: No implementation was bound
Guice configuration error: No implementation was bound
- Subject: Guice configuration error: No implementation was bound
- From: Raymond NANEON <email@hidden>
- Date: Tue, 23 Jul 2013 14:42:47 +0000 (GMT)
Hi List,
I try to use WOInject and Guice in my Apps and FWK but they cause a fail. Alexis gave me an example how to do but I don't understand the module I create is not added, the interface's injection create an Exception.
My FWK module code
public class RfcctModule extends AbstractModule {
/* (non-Javadoc)
* @see com.google.inject.AbstractModule#configure()
*/
@Override
protected void configure() {
// TODO Auto-generated method stub
bind(RechercheCompetenceService.class).to(RechercheCompetenceServiceImpl.class);
}
}
FwkUttCompetences class
public class FwkUttCompetences extends ERXFrameworkPrincipal {
static {
setUpFrameworkPrincipalClass(FwkUttCompetences.class);
}
/* (non-Javadoc)
* @see er.extensions.ERXFrameworkPrincipal#finishInitialization()
*/
@Override
public void finishInitialization() {
// TODO Auto-generated method stub
ModuleRegister moduleRegister = CktlWebApplication.application().getModuleRegister();
moduleRegister.addModule(new RfcctModule());
}
injection interface implementation
public class Accueil extends BaseComponent {
...
@Inject
private RechercheCompetenceService rechercheCompetenceService;
//EXCEPTION
}
Exception :
juil. 23 16:35:03 RFcct[8485] ERROR com.webobjects.foundation.InstantiationInterceptor - The instantiation of org.utt.rfcct.serveur.components.Accueil class has failed.
CreationException: Guice creation errors:
1) No implementation for org.utt.fwkuttcompetences.serveur.modele.rfcct.service.recherche.RechercheCompetenceService was bound.
while locating org.utt.fwkuttcompetences.serveur.modele.rfcct.service.recherche.RechercheCompetenceService
for field at org.utt.rfcct.serveur.components.Accueil.rechercheCompetenceService(Accueil.java:80)
at org.utt.rfcct.serveur.components.Accueil.class(Accueil.java:80)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:154)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:217)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:224)
I put a breakpoint in at the finishInitialization method of the FwkUttCompetences.Class but The Debug mode never break there. I think the FwkUttCompetences.Class is never read and I don't know why.
Thanks a lot for help.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden