Hi,
I've been trying to get Spring Security to work in my web application. Unfortunately no luck so far.
First of all my config:
web.xml
security-context.xmlCode:<context-param> <param-name>contextConfigLocation</param-name> <param-value> WEB-INF/security-context.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <filter> <filter-name>filterChainProxy</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>filterChainProxy</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
dispatcher-servlet.xmlCode:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd"> <security:http auto-config="true" > <security:form-login login-page="/login.html" default-target-url="/user/welcome.html"/> </security:http> <security:authentication-manager> <security:authentication-provider> <security:user-service id="userDetailsService"> <security:user password="password" name="username" authorities="ROLE_USER" /> </security:user-service> </security:authentication-provider> </security:authentication-manager> </beans>
I always get the same error when I start tomcat:Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> <context:component-scan base-package="be.test.social.controller, be.test.social.service, be.test.social.dao"/> <context:annotation-config/> <security:global-method-security secured-annotations="enabled"/> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="order" value="1" /> </bean> <!--<import resource="social-security.xml"/>--> </beans>
I'm using Tomcat7, Spring 3.1.0 and Spring Security 3.1.0Code:SEVERE: Exception starting filter filterChainProxy org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'filterChainProxy' is defined
Any help is appreciated
Regards,
Tim



Reply With Quote
