title: DefaultAdvisorAutoProxyCreator causing @Autowired dependencies to remain null
body: <p>My project is currently protected using Apache Shiro, and would like to add Shiro annotations for a cleaner source code.</p>
  
  <p>Apache Shiro asks you to include <code>DefaultAdvisorAutoProxyCreator</code> in order for Spring AOP to detect it.</p>
  
  <p>My configuration is as follows:</p>
  
  <pre><code>@Configuration
  @ComponentScan("com.mcac0006.flip")
  @EnableWebMvc
  public class AppContextConfiguration {
  
      @Autowired
      private JdbcRealm shiroRealm;
  
      @Bean(name="shiroFilter")
      public ShiroFilterFactoryBean getShiroFilter() {
          ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
          bean.setSecurityManager(getSecurityManager());
  
          return bean;
      }
  
      @Bean(name="securityManager")
      public DefaultSecurityManager getSecurityManager() {
          return new DefaultWebSecurityManager(shiroRealm);
      }
  
      @Bean
      public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor() {
          AuthorizationAttributeSourceAdvisor a = new AuthorizationAttributeSourceAdvisor();
          a.setSecurityManager(getSecurityManager());
          return a;
      }
  
      @Bean
      @DependsOn("authorizationAttributeSourceAdvisor")
      public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
          final DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator = new DefaultAdvisorAutoProxyCreator();
          return defaultAdvisorAutoProxyCreator;
      }
  }
  </code></pre>
  
  <p><br />
  In this example <code>shiroRealm</code> remains null and is causing all its dependants to fail. If I comment-out the last method <code>defaultAdvisorAutoProxyCreator()</code>, shiroRealm is instantiated just fine.</p>
  
  <p>What am I overlooking??</p>
  
  <p>Thanks guys.</p>