天使漫步IT工作室天使漫步IT工作室

No bean named 'springSecurityFilterChain' is defined


Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/u11u.com/usr/themes/wq/functions.php on line 110

Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/u11u.com/usr/themes/wq/functions.php on line 116

前几天在发开过程中出现了一下的异常信息:

Exception starting filter springSecurityFilterChain 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 
'springSecurityFilterChain' is defined 
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387) 
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:971) 
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:246) 
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) 
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) 
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:884) 
at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:216) 
at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:145) 
at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:179)

经过好几天的调试后总算解决,以下是一些解决步骤,希望对大伙有用。

解决方案:

  • 第一、有没有包冲突,一般将系统的删去,用spring security不会有问题。
  • 第二、确保在spring的xml里面有<http>声明默认初始化。
  • 第三、确保能够找到spring 的xml文件。
  • 第四、不要把springSecurityFilterChain写成"SpringSecurityFilterChain”,头一个字母不要是大写。我想其

中的原因应该是springSecurityFilterChain是默认的,所以要在命名上也要一致,要不然找不到这个bean。

(我在第四个错误上耗费了好几天的时间。希望能帮到后来人)

本站原创,欢迎转载,转载敬请标明出处:天使漫步IT工作室 » No bean named 'springSecurityFilterChain' is defined
添加新评论


Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /www/wwwroot/u11u.com/usr/themes/wq/comments.php on line 38