关于spring security的错误

信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory @8ddb93 : defining beans [org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.DefaultSecurityFilterChain# 0 ,org.springframework.security.web.PortMapperImpl# 0 ,org.springframework.security.web.PortResolverImpl# 0 ,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean# 0 ,org.springframework.security.authentication.ProviderManager# 0 ,org.springframework.security.web.context.HttpSessionSecurityContextRepository# 0 ,org.springframework.security.core.session.SessionRegistryImpl# 0 ,org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy# 0 ,org.springframework.security.web.savedrequest.HttpSessionRequestCache# 0 ,org.springframework.security.access.vote.AffirmativeBased# 0 ,org.springframework.security.web.access.intercept.FilterSecurityInterceptor# 0 ,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator# 0 ,org.springframework.security.authentication.AnonymousAuthenticationProvider# 0 ,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter# 0 ,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain# 1 ,org.springframework.security.provisioning.InMemoryUserDetailsManager# 0 ,org.springframework.security.authentication.dao.DaoAuthenticationProvider# 0 ,org.springframework.security.authentication.DefaultAuthenticationEventPublisher# 0 ,org.springframework.security.authenticationManager]; root of factory hierarchy
2013 - 10 - 4  10 : 07 : 16  org.springframework.web.context.ContextLoader initWebApplicationContext
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name  'org.springframework.security.filterChains' : Cannot resolve reference to bean  'org.springframework.security.web.DefaultSecurityFilterChain#1'  while  setting bean property  'sourceList'  with key [ 1 ]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name  'org.springframework.security.web.DefaultSecurityFilterChain#1' : 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' : Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/authentication/InternalAuthenticationServiceException
   
 
类似这样的错误大致是配置文件的问题
1.可以考虑从pom的Maven依赖入手,因为spring-security的依赖对spring的依赖要求较为严格
2.可以考虑从web.xml文件的配置想想办法,是否引入注解的spring-*xml....等等
3.

<security:authentication-manager>
<security:authentication-provider user-service-ref="userService">
<!-- 配置加密的方式 -->
<!-- <security:password-encoder ref="passwordEncoder"/> -->
</security:authentication-provider>
</security:authentication-manager>

存不存在userService相同的Service注解导致无法找到注解

希望能帮到你。有更好的想法可以讨论

转载于:https://www.cnblogs.com/JTrun/p/10976964.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值