title: Ambiguous handler methods for http path?
body: <p>I have a Spring application where I declared my class like so:</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/rest/api/datasources/", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
  public class MetadataServiceController {
      //Two separate methods:
      @RequestMapping(value="{datasourceName}")
      public Object getLatestApiMetadata(@PathVariable String datasource, 
             @RequestParam (required = false)  String datasourceNum,
             @RequestParam (defaultValue = "true")  String dataFields, 
             @RequestParam ( required=false, defaultValue = "api")  String visibility){
        ... //Implementation here
      }
  
      @RequestMapping(value="{apiVersion}")
      public @ResponseBody List&lt;DataSource&gt; getAllMetadata(
          @RequestHeader(value="sub-version", required=false, defaultValue="0.0") String minorVer,
          @PathVariable String restApiVersion,
          @RequestParam(required = false) String datasourceNum,
          @RequestParam(defaultValue = "all") String visibility)
          throws ObjectNotFoundException {
      ... //Implementation here
      }
  
  }
  </code></pre>
  
  <p>But when I try to reach one of these rest endpoints, I get an error saying: <code>java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path</code> and it specifies those two methods as the issue. I was under the impression that if I change the request parameters, Spring would not complain about them being the same via this post: <a href="http://www.coderanch.com/t/598675/Spring/handling-HTTP-Request-parameters" rel="nofollow">http://www.coderanch.com/t/598675/Spring/handling-HTTP-Request-parameters</a> but clearly it still does. Would anyone have any suggestions on how to get around this? Thanks!</p>