title: Spring security - org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
body: <p>I have read most of the similar issues that already posted but still I couldn't find a solution.
  Please note that regular CRUD application is working fine. I'm getting this error when I try to add login functionality via spring-security.</p>
  
  <p>My working environment is as follows;</p>
  
  <p><strong>1.Tomcat 7.0.35</strong></p>
  
  <p><strong>2.Spring 3.2.0</strong></p>
  
  <p><strong>3.Spring security</strong></p>
  
  <p>spring-security-config-3.1.3.RELEASE.jar</p>
  
  <p>spring-security-core-3.1.3.RELEASE.jar</p>
  
  <p>spring-security-taglibs-3.1.3.RELEASE.jar</p>
  
  <p>spring-security-web-3.1.3.RELEASE.jar</p>
  
  <p><strong>4.My web.xml (/src/main/webapp/WEB-INF/web.xml)</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee  
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;classpath:spring/root-context.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  
  &lt;!-- Processes application requests --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
              classpath:spring/conf/*-context.xml
          &lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;!-- 
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
       --&gt;
  &lt;/servlet&gt;
  
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>5.My security-context.xml (/src/main/resources/spring/conf/security-context.xml)</strong></p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
     &lt;beans:beans xmlns="http://www.springframework.org/schema/security"
       xmlns:beans="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns:p="http://www.springframework.org/schema/p" 
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
      http://www.springframework.org/schema/security 
      http://www.springframework.org/schema/security/spring-security-3.1.xsd
      http://www.springframework.org/schema/util 
      http://www.springframework.org/schema/util/spring-util-3.1.xsd"&gt;
  
  &lt;http pattern="/resources" security="none" /&gt;
  
  &lt;http auto-config="true"  use-expressions="true"&gt;
      &lt;intercept-url pattern="/login" access="permitAll"/&gt;
      &lt;intercept-url pattern="/logout" access="permitAll"/&gt;
      &lt;intercept-url pattern="/denied" access="hasRole('ROLE_USER')"/&gt;
      &lt;intercept-url pattern="/" access="hasRole('ROLE_USER')"/&gt;
      &lt;intercept-url pattern="/user" access="hasRole('ROLE_USER')"/&gt;
      &lt;intercept-url pattern="/admin" access="hasRole('ROLE_ADMIN')"/&gt;
  
      &lt;form-login login-page="/login" 
          authentication-failure-url="/login/failure" 
          default-target-url="/"/&gt;
  
      &lt;access-denied-handler error-page="/denied"/&gt;
  
      &lt;logout invalidate-session="true" 
          logout-success-url="/logout/success" 
          logout-url="/logout"/&gt;
  &lt;/http&gt;
  
  &lt;authentication-manager&gt;
          &lt;authentication-provider user-service-ref="customUserDetailsService"&gt;
                  &lt;password-encoder hash="md5"/&gt;
          &lt;/authentication-provider&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>6.Error</strong></p>
  
  <pre><code>INFO: Initializing Spring root WebApplicationContext
  INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
  INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Sun Feb 10 22:17:40 IST 2013]; root of context hierarchy
  INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring/root-context.xml]
  INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@58d51a54: defining beans []; root of factory hierarchy
  INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 353 ms
  10-Feb-2013 22:17:40 org.apache.catalina.core.StandardContext filterStart
  SEVERE: 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:549)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1096)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
      at  org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1121)
      at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:326)
      at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:236)
      at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:194)
      at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
      at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:107)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
      at  org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
      at  org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Please give me a help... Thanks</p>