java – Spring和Spring安全配置帮助,找不到bean

我一直收到一条消息:“org.springframework.beans.factory.NoSuchBeanDeFinitionException:没有定义名为’userDetailsS​​ervice’的bean”,即使bean被定义为UserDetailsS​​erviceImpl类中的服务.如:

@Service(value="userDetailsService")
public class UserDetailsServiceImpl implements UserDetailsService{

我正在使用最新的Spring和Spring Security.

我不确定我做错了什么.我正在粘贴我的spring xml文件的配置. spring-security.xml显示它在使用组件扫描时可以从servlet-context.xml中找到bean.

谢谢

org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.security.filterChains': Cannot resolve reference to bean org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0' while setting constructor argument with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0': Cannot resolve reference to bean org.springframework.security.authentication.ProviderManager#0' while setting bean property authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.security.authentication.ProviderManager#0': Cannot resolve reference to bean 'org.springframework.security.config.authentication.AuthenticationManagerfactorybean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.security.config.authentication.AuthenticationManagerfactorybean#0': factorybean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.security.authenticationManager': Cannot resolve reference to bean org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.NoSuchBeanDeFinitionException: No bean named 'userDetailsService' is defined

弹簧security.xml文件

ecurity"
xmlns:beans="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security-3.1.xsd">


sspath*:servlet-context.xml"/> 

ecurity secured-annotations="enabled">ecurity>    

fig="true" >
    
                

相关文章

这篇文章主要介绍了spring的事务传播属性REQUIRED_NESTED的原...
今天小编给大家分享的是一文解析spring中事务的传播机制,相...
这篇文章主要介绍了SpringCloudAlibaba和SpringCloud有什么区...
本篇文章和大家了解一下SpringCloud整合XXL-Job的几个步骤。...
本篇文章和大家了解一下Spring延迟初始化会遇到什么问题。有...
这篇文章主要介绍了怎么使用Spring提供的不同缓存注解实现缓...