我跟隨this tutorial來保護我的GWT應用程序與Spring安全。GWT和Spring安全:org.springframework.beans.factory.NoSuchBeanDefinitionException
然而,把
<!-- Spring Security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/app</url-pattern>
</filter-mapping>
<!-- END FILTERS -->
<!-- BEGIN Listeners -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- END Listeners -->
<context-param>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath:/**/spring-config.xml
</param-value>
</context-param>
到我的web.xml文件導致一個org.springframework.beans.factory.NoSuchBeanDefinitionException
例外。堆棧跟蹤:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:660)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1157)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:280)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:962)
at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:324)
at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235)
at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
...
我不明白爲什麼我得到這個異常 - 我錯過了什麼?
嗨!嗯..但你在哪裏實際聲明'springSecurityFilterChain'? – displayname
這是filterChainProxy的別名,答案已更新。 – kolunar
嗨!對不起,遲到的答案,但我很忙,不能繼續這一點,直到現在。那麼,我真的沒有得到這個。您發佈的鏈接在哪裏聲明瞭它的FilterChainProxy,以及我發佈的示例在哪裏做了?而我不能只是改變'filterChainProxy'到'springSecurityFilterChain'? – displayname