title: @Component annotation is not working
body: <p>Please advise where I am going wrong here.  @Component and @Qualifier is not working.  Getting No such bean defined exception.</p>
  
  <p>I have spring security xml, a part of that is follows</p>
  
  <pre><code>&lt;http use-expressions="true" create-session="stateless" &gt;
  &lt;form-login login-page="/inventory/auth/login"
          always-use-default-target="true" default-target-url="/inventory/secureauth"         
          authentication-failure-url="/inventory/secureauth/login?login_error=1" 
          username-parameter="username" password-parameter="password" /&gt;
  
      &lt;custom-filter position="PRE_AUTH_FILTER" ref="cookieSessionFilter" /&gt;          
  &lt;/http&gt;
  
  &lt;authentication-manager alias="authenticationManager"&gt;
      &lt;authentication-provider ref="userAuthenticationProvider" /&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>I wrote a AbstractPreAuthenticatedProcessingFilter as follows</p>
  
  <pre><code>package com.eim.security;
  
  @Component(value="cookieSessionFilter")
  public class CookieSessionFilter extends AbstractPreAuthenticatedProcessingFilter {
  
   @Autowired
  public CookieSessionFilter(@Qualifier(value="authenticationManager") AuthenticationManager authenticationManager) {
      setAuthenticationManager(authenticationManager);
  }
  </code></pre>
  
  <p>Please find my spring dispatcher servlet xml</p>
  
  <pre><code>&lt;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:aop="http://www.springframework.org/schema/aop" xmlns:cache="http://www.springframework.org/schema/cache"
  xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:util="http://www.springframework.org/schema/util"
  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
  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.xsd
          http://www.springframework.org/schema/mvc 
          http://www.springframework.org/schema/mvc/spring-mvc.xsd
          http://www.springframework.org/schema/util 
          http://www.springframework.org/schema/util/spring-util.xsd
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop.xsd
          http://www.springframework.org/schema/tx 
          http://www.springframework.org/schema/tx/spring-tx.xsd
          http://www.springframework.org/schema/cache
          http://www.springframework.org/schema/cache/spring-cache.xsd"&gt;
  &lt;context:annotation-config /&gt;
  &lt;mvc:annotation-driven /&gt;
  
  &lt;context:component-scan 
      base-package="com.eim.security, com.eim.glossary.controller"&gt;
  &lt;/context:component-scan&gt;
  </code></pre>
  
  <p>I am getting the following exception</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with     name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#9' while setting bean property 'sourceList' with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#9': Cannot resolve reference to bean 'cookieSessionFilter' while setting constructor argument with key [2]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cookieSessionFilter' is defined
  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
  </code></pre>
  
  <p>Not sure why I am getting the below exception as I gave base-package for component scan to Spring container</p>
  
  <pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cookieSessionFilter'
  </code></pre>
  
  <p>Kindly advise please</p>