No bean named 'springSecurityFilterChain' is defined solution

When you start tomcat: No bean named 'springSecurityFilterChain' is defined

Looked, in web.xml,
<? Xml version = "1.0" encoding = "UTF-8"?>
<Web-app xmlns = "http://java.sun.com/xml/ns/j2ee" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" version = "2.4"
xsi: schemaLocation = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name> uim </ display-name>

<! - Spring ApplicationContext configuration file path, you can use wildcards, to use multiple paths, this parameter is used to separate the numbers behind the Spring Context Loader ->
<context-param>
<param-name> contextConfigLocation </ param-name>
<param-value> classpath *: / applicationContext *. xml </ param-value>
</ Context-param>

<! - Spring ApplicationContext loading ->
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener </ listener-class>
</ Listener>
<! - Spring Refresh Introspector prevent memory leaks ->
<listener>
<listener-class> org.springframework.web.util.IntrospectorCleanupListener </ listener-class>
</ Listener>

<! - Filter definition ->
<! - Character Encoding filter ->
<filter>
<filter-name> encodingFilter </ filter-name>
<filter-class> org.springframework.web.filter.CharacterEncodingFilter </ filter-class>
<init-param>
<param-name> encoding </ param-name>
<param-value> UTF-8 </ param-value>
</ Init-param>
<init-param>
<param-name> forceEncoding </ param-name>
<param-value> true </ param-value>
</ Init-param>
</ Filter>

<! - Hibernate Open Session In View filter ->
<filter>
<filter-name> hibernateOpenSessionInViewFilter </ filter-name>
<filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter </ filter-class>
</ Filter>

<! - SpringSecurity filter ->
<filter>
<filter-name> springSecurityFilterChain </ filter-name>
<filter-class> org.springframework.web.filter.DelegatingFilterProxy </ filter-class>
</ Filter>
<! - Struts2 filter ->
<filter>
<filter-name> struts2CleanupFilter </ filter-name>
<filter-class> org.apache.struts2.dispatcher.ActionContextCleanUp </ filter-class>
</ Filter>

<filter>
<filter-name> struts2Filter </ filter-name>
<filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </ filter-class>
</ Filter>

<! - Filter mappings ->
<filter-mapping>
<filter-name> encodingFilter </ filter-name>
<url-pattern> / * </ url-pattern>
</ Filter-mapping>

<filter-mapping>
<filter-name> hibernateOpenSessionInViewFilter </ filter-name>
<url-pattern> *. action </ url-pattern>
</ Filter-mapping>
<filter-mapping>
<filter-name> hibernateOpenSessionInViewFilter </ filter-name>
<url-pattern> / j_spring_security_check </ url-pattern>
</ Filter-mapping>

<filter-mapping>
<filter-name> springSecurityFilterChain </ filter-name>
<url-pattern> / * </ url-pattern>
</ Filter-mapping>
<filter-mapping>
<filter-name> struts2CleanupFilter </ filter-name>
<url-pattern> *. action </ url-pattern>
<dispatcher> REQUEST </ dispatcher>
<dispatcher> FORWARD </ dispatcher>
</ Filter-mapping>

<filter-mapping>
<filter-name> struts2Filter </ filter-name>
<url-pattern> *. action </ url-pattern>
<dispatcher> REQUEST </ dispatcher>
<dispatcher> FORWARD </ dispatcher>
</ Filter-mapping>

<! - Session timeout defined in minutes ->
<session-config>
<session-timeout> 20 </ session-timeout>
</ Session-config>

<! - Error page definition ->
<error-page>
<exception-type> java.lang.Throwable </ exception-type>
<location> / common/500.jsp </ location>
</ Error-page>
<error-page>
<error-code> 500 </ error-code>
<location> / common/500.jsp </ location>
</ Error-page>
<error-page>
<error-code> 404 </ error-code>
<location> / common/404.jsp </ location>
</ Error-page>
<error-page>
<error-code> 403 </ error-code>
<location> / common/403.jsp </ location>
</ Error-page>
<welcome-file-list>
<welcome-file> welcome.jsp </ welcome-file>
</ Welcome-file-list>
</ Web-app>
Defined above, the springSecurityFilterChain, in applicationContext-security.xml in: <? Xml version = "1.0" encoding = "UTF-8"?>
<Beans xmlns = "http://www.springframework.org/schema/beans" xmlns: s = "http://www.springframework.org/schema/security"
xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi: schemaLocation = "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd "
default-autowire = "byType" default-lazy-init = "true">

<description> use SpringSecurity security configuration file </ description>

<! - Http security configuration ->
<s:http auto-config="true" access-decision-manager-ref="accessDecisionManager">
<S: form-login login-page = "/ login.action" default-target-url = "/ index.action"
authentication-failure-url = "/ login.action? error = true" />
<s:logout logout-success-url="/index.action" />

<s:remember-me key="e37f4b31-0c45-11dd-bd0b-0800200c9a66" />
</ S: http>

<! - Authentication configuration ->
<s:authentication-provider user-service-ref="userDetailsService">
<! - Can be set to use sha1 or md5 hash hash the password and then stored in the database ->
<s:password-encoder hash="plaintext" />
</ S: authentication-provider>

<! - Project services to achieve the user query ->
<bean />

<! - Redefined FilterSecurityInterceptor, use databaseDefinitionSource url-licensing relationship provides the definition of ->
<bean>
<s:custom-filter before="FILTER_SECURITY_INTERCEPTOR" />
<property name="accessDecisionManager" ref="accessDecisionManager" />
<property name="objectDefinitionSource" ref="databaseDefinitionSource" />
</ Bean>

<! - DefinitionSource plant, using resourceDetailsService provides URL-licensing relationship. ->
<bean>
<property name="resourceDetailsService" ref="resourceDetailsService" />
</ Bean>

<! - Project achieved URL-authorization inquiry service ->
<bean />

<! - Judge authorized configuration, the default prefix will be authorized to name change by the ROLE_ A_. ->
<bean>
<property name="decisionVoters">
<list>
<bean>
<property name="rolePrefix" value="A_" />
</ Bean>
<bean />
</ List>
</ Property>
</ Bean>
</ Beans>

I have read, checked, but still do not know is a problem with web.xml security configuration files or the problem? , Someone help me with? ? Thank you for the!

分类:Web 时间:2010-05-10 人气:332
分享到:
blog comments powered by Disqus

相关文章

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.314 (s). 14 q(s)