我正在使用Spring Security 3.2和Spring 4.0.1
我正在将xml配置转换为Java配置。当我在“过滤器”中添加注释AuthenticationManager时@Autowired,出现异常
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.security.authentication.AuthenticationManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
我已经尝试了注入,AuthenticationManagerFactoryBean但是由于类似的异常也失败了。
这是我正在使用的XML配置
realm="Protected API"
use-expressions="true"
auto-config="false"
create-session="stateless"
entry-point-ref="unauthorizedEntryPoint"
authentication-manager-ref="authenticationManager">