Bonjour,
Je travailles sur une architecture MVC.
Depuis de front-end j'appelle un contrôleur (back-end) issu d'une de mes libraires.
A ce moment là (donc dans ma lib JAR) , j’appelle mon service, qui lui appelle mon DAO.
Jusque là tout ce passe bien.
En fait, ce DAO est précédé de l'annotation @Autowired et c'est à ce moment que j'ai une erreur de ce style :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SOME_NAME': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: PROJECT.services.SERVICE_NAME PROJECT.controllers.CONTROLLER_NAME.SERVICE_NAME ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SOME_NAME': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void PROJECT.services.SERVICE_NAME .FUNCTION_NAME(PROJECT.dao.DAO_NAME); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [PROJECT.dao.DAO_NAME] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
Le bean n'est pas initialisé si j'ai bien compris.
Si vous avez des idée, ou besoin de plus informations, je reste à disposition.
Merci d'avance,
Cdlt
Partager