title: Getting different http status code than expected
body: <p>I'm implementing a REST API with Jersey Controllers.</p>
  
  <p>On some cases I want to return error status codes like 400, 501, etc. that are being generated by a sentence like:</p>
  
  <pre><code>throw new WebApplicationException("Error", 501);
  </code></pre>
  
  <p>When I deploy the app in local, everything works ok. However, when I deploy it in a Docker image, for any error that the controller throws, the client gets a 404 status code. </p>
  
  <p>I included traces just before throwing the Exceptions to be sure that the code was executed. And it is.</p>
  
  <p>Seems as if at some code layer, different from the application, the status codes were being converted from 400 or 501 or 502 to 404, and that is what the client is getting.</p>
  
  <p>Any clues?</p>