title: Autowired field gives me null exception
body: <p>I have a class that uses a method from a bean.</p>
  
  <p>I'm trying to inject that method into my class using <code>@Autowired</code>, but it gives me NullPointerException.</p>
  
  <pre><code>public class ChangePasswordServiceImpl extends RemoteServiceServlet implements
          ChangePasswordService {
  
      @Autowired
      @Qualifier("userDetailsManager")
      private JdbcUserDetailsManager userDetailsManager;
  
      @Override
      public void changePassword(String oldPassword, String newPassword) {
  
          // This is the line that throws NullPointerException, i.e., userDetails
          // Manager is not being injected by Spring
          userDetailsManager.changePassword(oldPassword, newPassword);
  
      }
  
  }
  </code></pre>
  
  <p>My <strong>xml</strong> file:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jdbc="http://www.springframework.org/schema/jdbc"
      xmlns:context="http://www.springframework.org/schema/context"
  
      xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
               http://www.springframework.org/schema/jdbc
               http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;context:annotation-config/&gt;
  
      &lt;bean id="securityDataSource" class="org.apache.commons.dbcp.BasicDataSource"
          destroy-method="close"&gt;
  
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="url"
              value="jdbc:mysql://localhost:3306/login" /&gt;
          &lt;property name="username" value="root" /&gt;
          &lt;property name="password" value="password" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="userDetailsManager"
          class="org.springframework.security.provisioning.JdbcUserDetailsManager"&gt;
          &lt;property name="dataSource" ref="securityDataSource" /&gt;
          &lt;property name="authenticationManager" ref="authenticationManager" /&gt;
          &lt;qualifier value="userDetailsManager"/&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Why is this field not being filled? Am I missing something?</p>