title: Enable Shiro annotations in Spring based application
body: <p>I have project with two modules – <em>web</em> and <em>buisness</em>.</p>
  
  <p>In <em>web module</em>, there is a shiro.ini file with configuration (as in the tutorial – <a href="https://github.com/lhazlewood/apache-shiro-tutorial-webapp/blob/step7/src/main/webapp/WEB-INF/shiro.ini" rel="nofollow">https://github.com/lhazlewood/apache-shiro-tutorial-webapp/blob/step7/src/main/webapp/WEB-INF/shiro.ini</a> – with my own properties).</p>
  
  <p>In <em>buisness module</em>, there is a applicationContext.xml file with this code:</p>
  
  <pre><code>&lt;bean id="iniRealm" class="org.apache.shiro.realm.text.IniRealm"&gt;
      &lt;property name="resourcePath" value="file:C:\project\webmodule\src\main\webapp\WEB-INF\shiro.ini" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" /&gt;
  
  &lt;bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor" /&gt;
  
  &lt;bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"&gt;
      &lt;property name="realm" ref="iniRealm" /&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor"&gt;
      &lt;property name="securityManager" ref="securityManager" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But if I want to use annotations, like <code>@RequiresAuthentication</code>, it doesn't work.</p>
  
  <p>Is the configuration in applicationContext.xml enough? Where can be a mistake? The authentication in <em>web module</em> works fine.</p>
  
  <p>Can it be problem with filters? Do I have to define two filters, one with <code>&lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;</code> and another with <code>&lt;filter-class&gt;org.apache.shiro.web.servlet.ShiroFilter&lt;/filter-class&gt;</code>? 
  Thank you for any advice.</p>