title: There is already bean method mapped
body: <p>I am getting the following exception:</p>
  
  <pre><code>&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;root cause&lt;/b&gt; &lt;pre&gt;org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': 
  Invocation of init method failed; nested exception is java.lang.IllegalStateException: 
  Ambiguous mapping found. Cannot map 'sdtm-controller' bean method 
  public java.util.List&amp;lt;java.lang.String&amp;gt; com.sas.hls.clc.clinicalstandards.sdtm.SDTM_Controller.getVersions()
  to {[/getVersions],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: 
  There is already 'SDTM_Controller' bean method
  public java.util.List&amp;lt;java.lang.String&amp;gt; com.sas.hls.clc.clinicalstandards.sdtm.SDTM_Controller.getVersions() mapped.
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
      org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
      org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:647)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:598)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:661)
      org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:517)
      org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:458)
      org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)
      javax.servlet.GenericServlet.init(GenericServlet.java:212)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      java.lang.Thread.run(Thread.java:662)
  &lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;root cause&lt;/b&gt; &lt;pre&gt;java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'sdtm-controller' bean method 
  public java.util.List&amp;lt;java.lang.String&amp;gt; com.sas.hls.clc.clinicalstandards.sdtm.SDTM_Controller.getVersions()
  to {[/getVersions],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'SDTM_Controller' bean method
  public java.util.List&amp;lt;java.lang.String&amp;gt; com.sas.hls.clc.clinicalstandards.sdtm.SDTM_Controller.getVersions() mapped.
  </code></pre>
  
  <p>My controller class only has a single method called getVersions(). My application was working fine when I was using AutoWired on my Controller and did not explicit wire together any beans. But then I switched to defining some beans so that I could hook into beans written by others on the project. I started getting duplicate beans exceptions, so I commented out the @Autowired annotation. Why am I getting this. Are there remnants of the autowiring still in my deployed environment???</p>
  
  <pre><code>@Controller
  public class SDTM_Controller {
      private SDTM_Service service;
  
  //  @Autowired
      public SDTM_Controller(SDTM_Service service){
          this.service = service;
      }
  
      public SDTM_Controller(){
  
      }
  
      public void setSDTM_Service(SDTM_Service service){
          this.service = service;
      }
  
      // URL: sdtm/getVersions
  
      @RequestMapping(value="/getVersions", method=RequestMethod.GET)
      public @ResponseBody List&lt;String&gt; getVersions(){
          return service.getVersions();
      }
  </code></pre>
  
  <p>My web.xml includes the following:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;sdtm&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/sdtm-servlet.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;sdtm&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/sdtm/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I have a file named sdtm-servlet.xml that includes the following:</p>
  
  <pre><code>    &lt;context:component-scan base-package="com.sas.hls.clc.clinicalstandards.sdtm" /&gt;    
  &lt;mvc:annotation-driven/&gt;
  
      &lt;bean id="sdtm-controller" class="com.sas.hls.clc.clinicalstandards.sdtm.SDTM_Controller" &gt;    
              &lt;property name="SDTM_Service" ref="SDTM_Service" /&gt;  
      &lt;/bean&gt;
  </code></pre>
  
  <p>Lastly, I have a services-config.xml file that defines a service.</p>
  
  <pre><code>   &lt;bean id="sdtmService" class="com.sas.hls.clc.clinicalstandards.sdtm.SDTM_ServiceImpl" &gt;
          &lt;property name="clinicalStandardsInterface" ref="clinicalStandardsInterface" /&gt;
     &lt;/bean&gt;
  </code></pre>