title: Spring Application Context Load Order
body: <p>On my web.xml I have a "springmvc" servlet declaration (which has a corresponding springmvc-servlet.xml)</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;springmvc&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;springmvc&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/myapp/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I also have my usual applicationContext.xml file. </p>
  
  <p>Which one gets loaded first? The springmvc-servlet.xml or the applicationContext.xml?</p>
  
  <p>The reason I'm asking this is whenever I place the <code>&lt;mvc:annotation-driven/&gt;</code> element in the applicationContext.xml, I get a Severe Context error. But when I put that element in the springmvc-servlet.xml, my web app runs fine. </p>
  
  <p>Any ideas why?</p>
  
  <p>On another web-app, I have the <code>&lt;mvc:annotation-driven/&gt;</code> inside the applicationContext.xml and it runs fine.</p>
  
  <p>Addendum: 
  I do notice that the presence of <strong>aop:config</strong> poses conflict against <strong>mvc:annotation-driven</strong> </p>