title: Spring Boot in standalone Tomcat ignores exceptions set in DeferredResults
body: <p>I'm running a Spring Boot 1.2.1 application in standalone Tomcat.  </p>
  
  <p>I have two controller mappings, which both for simplicity always throw an exception.  The first one is for a GET request and it returns a String for the view name:</p>
  
  <pre><code>    @RequestMapping(value = {
      "/index"
  }, method = RequestMethod.GET)
  public String init() throws MyRequestProcessingException {
      if (true) {
      throw new MyRequestProcessingException(
              "Something went wrong processing request");
      }
      return "init";
  }
  </code></pre>
  
  <p>This is the exception definition:</p>
  
  <pre><code>@ResponseStatus(value=HttpStatus.INTERNAL_SERVER_ERROR)
  public class MyRequestProcessingException extends Exception {
  
  public MyRequestProcessingException(String message) {
      super(message);
  }   
  }
  </code></pre>
  
  <p>In embedded Tomcat as well as in standalone Tomcat, trying to access /index always results in a 500 with some JSON error data being returned to the client.</p>
  
  <p>My controller has another method which accepts a POST and returns a DeferredResult:</p>
  
  <pre><code>   @RequestMapping(value = "html/start", method = RequestMethod.POST, consumes = APPLICATION_FORM_URLENCODED)
  public DeferredResult&lt;String&gt; start(final HttpServletResponse response,
                                      @Valid @ModelAttribute final InitialisationStartAttributes model,
                                      final SessionData sessionExisting) throws MyRequestProcessingException {
      final DeferredResult&lt;String&gt; finalResult = new DeferredResult&lt;&gt;(5000);
  
                  // Just return an error, so we can test
                  if (true) {
                      finalResult.setErrorResult(new MyRequestProcessingException(
                              "Something went wrong processing request"));
                  }
  
      return finalResult;
  }
  </code></pre>
  
  <p>In embedded Tomcat, a POST to /html/start returns a 500 with some JSON data in the response body, just like the other request method.  However, when I try to reproduce this behaviour using a standalone Tomcat instance, I always get a 200 response with no response body. </p>
  
  <p>I'm using Tomcat 8 in embedded and Tomcat 7.0.52 standalone, but I've also tried with standalone Tomcat 8 and it doesn't make a difference.</p>
  
  <p>My application is deployed in the root application context by modifying /etc/tomcat/Catalina/localhost/ROOT.xml.</p>
  
  <p>EDIT: I've done a bit more testing, and it does seem that DeferredResult is the culprit.  I have yet to override handleErrorResult() to see what happens.  I'm a bit surprised though, because I don't recall seeing anything in the documentation about the difference between returning a DeferredResult in embedded vs standalone Tomcat.</p>