title: Spring Boot Remove Whitelabel Error Page
body: <p>I'm trying to remove white label error page, so what I've done was created a controller mapping for "/error",</p>
  
  <pre><code>@RestController
  public class IndexController {
  
      @RequestMapping(value = "/error")
      public String error() {
          return "Error handling";
      }
  
  }
  </code></pre>
  
  <p>But now I"m getting this error.</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource   [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Invocation  of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'basicErrorController' bean method 
  public org.springframework.http.ResponseEntity&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt;  org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletR equest)
  to {[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'indexController' bean method
  </code></pre>
  
  <p>Don't know whether I'm doing anything wrong. Please advice.</p>
  
  <p><B>EDIT: </B></p>
  
  <p>Already added
      <code>error.whitelabel.enabled=false</code>  to application.properties file, still getting the same error</p>