title: Spring3's @Configuration cannot @Inject component-scanned beans
body: <p>This is my app.xml :</p>
  
  <pre><code>&lt;context:component-scan base-package="destiny.web" /&gt;
  &lt;context:annotation-config/&gt;
  </code></pre>
  
  <p>And there is a <code>Dao</code>(interface) , and <code>DaoImpl</code> (annotated with <code>@Repository</code>) inside destiny.web package.</p>
  
  <p>There is another Spring3's destiny.web.AppConfig class :</p>
  
  <pre><code>@Configuration
  public class AppConfig
  {
    @Inject
    private Dao daoImpl
  
    public AppConfig()
    {
      System.out.println("dao = " + daoImpl);
    }
  }
  </code></pre>
  
  <p>It prints 'null' , why ?</p>
  
  <p>I am sure all these beans/configuration/repositories are scanned. But it seems @Configuration doesn't know other scanned beans . Did I miss anything ?</p>
  
  <p>I try to solve it by @ImportResource :</p>
  
  <pre><code>@Configuration
  @ImportResource("classpath:app.xml")
  public class AppConfig
  </code></pre>
  
  <p>But it seems causing cyclic bean scan and throws this exception :</p>
  
  <pre><code>{main} org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Only one AsyncAnnotationBeanPostProcessor may exist within the context.
  Offending resource: class path resource [app.xml]
  </code></pre>
  
  <p>How to solve it ?</p>
  
  <p>Thanks.</p>