title: @Service are constructed twice
body: <p>I have a problem with my Spring application where my @Service classes are being created twice when the application starts. I know this is a problem with my configuration, as I've experienced it before, but what exactly am I doing wrong?</p>
  
  <p>Is there anything fundamentally wrong with the way I've laid out my config, below? (I have omitted everything I deem to be irrelevant)</p>
  
  <p><strong>web.xml:</strong></p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;myapp&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;myapp&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;
          /WEB-INF/myapp-config.xml
          /WEB-INF/myapp-security.xml
          /WEB-INF/myapp-mvc.xml
      &lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;com.myapp.servlet.MyAppContextListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p><strong>myapp-servlet.xml</strong></p>
  
  <pre><code>&lt;context:component-scan base-package="com.myapp" annotation-config="true" /&gt;
  &lt;mvc:annotation-driven /&gt;
  </code></pre>
  
  <p><strong>myapp-config.xml</strong></p>
  
  <pre><code>&lt;context:component-scan base-package="com.myapp" annotation-config="true" /&gt;
  &lt;context:annotation-config /&gt;
  </code></pre>