2016-06-02 5 views
0

Bitte, warum habe ich diesen Fehler, wenn ich meine Anwendung ausführenorg.springframework.beans.factory.BeanCreationException: Fehler Bohne Erstellung mit dem Namen ‚securityServiceImpl‘:

SEVERE: StandardWrapper.Throwable 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityServiceImpl': Injection of autowired dependencies failed; 
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.authentication.AuthenticationManager com.springfoundation.service.SecurityServiceImpl.authenticationManager; 
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
    No unique bean of type [org.springframework.security.authentication.AuthenticationManager] is defined: 
    expected single matching bean but found 3: 
    [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0, 
    org.springframework.security.authentication.ProviderManager#0, 
    org.springframework.security.authenticationManager] 

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) 

Dies ist der zweite Stacktrace

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.authentication.AuthenticationManager com.springfoundation.service.SecurityServiceImpl.authenticationManager; 
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
    No unique bean of type [org.springframework.security.authentication.AuthenticationManager] is defined: 
    expected single matching bean but found 3: 
    [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0, 
    org.springframework.security.authentication.ProviderManager#0, 
    org.springframework.security.authenticationManager] 

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:513) 

Was ist los?

+0

Irgendwie haben Sie sich registriert ** Three ** 'AuthenticationManager's. Veröffentlichen Sie weitere Details zu Ihren Konfigurationen. –

+0

Könnten Sie bitte etwas von Ihrem Code posten? Wie sieht Ihre Datei spring-servlet.xml aus? – Lexi

+0

@AliDehghani Welchen Abschnitt des Codes suchen Sie? – Blaze

Antwort

0

Die obige Ausnahme bedeutet, dass Sie möglicherweise vergessen haben, eine Bean zu definieren, die Ihre DAO-Schnittstelle implementiert.

<bean id="object name" class="com.java.model.FirstModelImple" /> 
+0

wo plase .... – Blaze

+0

in Ihrer XML-Konfiguration – BohdanZ

+0

Überprüfen Sie den Kommentar nd Sie sehen alle meine XML-Konfiguration – Blaze

Verwandte Themen