title: Spring @Autowired not working
body: <p>I have some problems wth autowire annotation. My app looks like this:</p>
  
  <p>Here is controller:</p>
  
  <pre><code>@Controller
  public class MyController {
      @Autowired
      @Qualifier("someService")
      private SomeService someService;
  
      ....
  }
  </code></pre>
  
  <p>It's a service layer:</p>
  
  <pre><code>public interface SomeService {
      ...
  }
  
  @Service
  public class SomeServiceImpl implements SomeService{    
      @Autowired
      @Qualifier("myDAO")
      private MyDAO myDAO;
  
      ....
  }
  </code></pre>
  
  <p>And DAO layer:</p>
  
  <pre><code>public interface MyDAO{
      ....        
  }
  
  @Repository
  public class JDBCDAOImpl implements MyDAO {    
      @Autowired
      @Qualifier("dataSource")
      private DataSource dataSource;    
      ....
  }
  </code></pre>
  
  <p>This is a app-service.xml file:</p>
  
  <pre><code>....
  &lt;bean id="propertyConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
        p:location="/WEB-INF/jdbc.properties" /&gt;
  
  &lt;bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource"
        p:driverClassName="${jdbc.driverClassName}"
        p:url="${jdbc.url}"
        p:username="${jdbc.username}"
        p:password="${jdbc.password}"/&gt;
  
  &lt;bean id="SomeService" class="com.service.SomeServiceImpl" /&gt;    
  &lt;bean id="myDAO" class="com.db.JDBCDAOImpl" /&gt;    
  </code></pre>
  
  <p>So... When I'm launching a web-app, MyController Autowires correctly (the someService field correctly injected by SomeServiceImpl class object), but myDAO feild of someService has null value (not injected properly).</p>
  
  <p>Could you help me to find a problem?</p>
  
  <p>P.S. Its interesting, but when I'm changing a "bean id" from myDAO to some another (e.g. myDAO2), system gives me an error, that injecting could not be done, because bean myDAO doesn't exist. So, Spring make an injection, but where it is? And why it's not work correctly?</p>