title: Problem while developing spring controller, every time I get Ambiguous mapping
body: <p>The error I'm getting:  </p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'tagController' method 
  public java.util.List&lt;javaBrains.model.Tag&gt; javaBrains.controller.TagController.getAllTags()
  to {}: There is already 'tagController' bean method
  public javaBrains.model.Tag javaBrains.controller.TagController.getTag(java.lang.String) mapped.
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:621) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:589) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:315) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambda$detectHandlerMethods$1(AbstractHandlerMethodMapping.java:282) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at java.util.LinkedHashMap.forEach(Unknown Source) ~[na:1.8.0_171]
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:280) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.processCandidateBean(AbstractHandlerMethodMapping.java:252) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:211) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:199) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:164) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.ResponseBody;
  import org.springframework.web.bind.annotation.RestController;
  
  import java.util.List;
  import java.util.Arrays;
  
  import javax.websocket.server.PathParam;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.PathVariable;
  
  
  
  import javaBeans.repository.AdminUserRepository;
  import javaBeans.repository.TagRepository;
  import javaBrains.model.AdminUser;
  import javaBrains.model.Tag;
  import javaBrains.services.TagService;
  
  @RestController
  public class TagController {
  
  
      @Autowired
      private TagService tagService;
  
      @RequestMapping("/tags")
      public List&lt;Tag&gt; getAllTags() {
  
          return tagService.producer();
      }
  
      @RequestMapping("/tags/{id}")
      public Tag getTag(@PathVariable String id)
      {
          return tagService.getTag(id);
      }
  }
  </code></pre>