天使漫步IT工作室

No bean named 'springSecurityFilterChain' is defined


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

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)

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

解决方案:

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

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

当前页面是本站的「Baidu MIP」版。查看和发表评论请点击:完整版 »