Bonjour,
J'ai un petit souci avec l'injection :s !!
Actuellement, j'utilise spring security.
voici ma conf xml :
Code Java ipAuthenticationProvider :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <bean id="ipAuthenticationProvider" class="fr.xxx.ip.middle.authentication.ipAuthenticationProvider"> <security:custom-authentication-provider/> </bean>
Code Java ApiSecuServiceImpl
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 @Service("authenticationProvider") public class ipAuthenticationProvider implements AuthenticationProvider { static final private Log logger = LogFactory .getLog(ipAuthenticationProvider.class); @Autowired @Qualifier("apiSecuService") private ApiSecuService apiSecuService1; ....
Quand j'essaie de m'authentifier, je lance la soumission du formulaire, j'obtiens cette stacktrace :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 @Service("apiSecuService") public class ApiSecuServiceImpl implements ApiSecuService { @Override public String checkDN(String subjectDn) { return null; } .....
J'ai testé mon authentification sans injection, en instanciant directement l'objet dans le constructeur, ça marche. Mais je souhaite passer par injection, mais là, ça plante, et je sais pas pourquoi :s !!!2010-06-24 14:38:20.864:WARN::Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ipAuthenticationProvider': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private fr.xxx.ip.service.ApiSecuService fr.xxx.ip.middle.authentication.ipAuthenticationProvider.apiSecuService1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [fr.xxx.ip.service.ApiSecuService] is defined: Unsatisfied dependency of type [interface fr.xxx.ip.service.ApiSecuService]: expected at least 1 matching bean:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [fr.xxx.ip.service.ApiSecuService] is defined: Unsatisfied dependency of type [interface fr.xxx.ip.service.ApiSecuService]: expected at least 1 matching bean
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:613)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:412)
at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105)
Si vous avez la moindre idée, je suis preneur![]()
Partager