title: Packaged Spring boot application doesnt resolve rest api errors to a message
body: <p>I have a spring boot application where I am currently running it with <code>mvnw spring-boot:run</code>
  I have setup a custom exception like so</p>
  <pre><code>@ResponseStatus(value = HttpStatus.BAD_REQUEST)
  public class InvalidEntityException extends Exception {
  
      public InvalidEntityException() {
          super();
      }
  
      public InvalidEntityException(String message) {
          super(message);
      }
  
      public InvalidEntityException(String message, Throwable cause) {
          super(message, cause);
      }
  
      public InvalidEntityException(Throwable cause) {
          super(cause);
      }
  }
  </code></pre>
  <p>In a method in a rest controller I can throw this exception and in the Spring Boot logs I can see
  <code>Resolved [foo.bar.InvalidEntityException: Error message.]</code></p>
  <p>And in the JSON response my data looks like this:</p>
  <pre><code>error: &quot;Bad Request&quot;
  message: &quot;Error message&quot;
  path: &quot;/resource/request&quot;
  status: 400
  timestamp: &quot;2021-06-06T04:12:39.759+00:00&quot;
  </code></pre>
  <p>However, when I go and run <code>mvn clean package</code> and run my output .jar file using <code>java -jar out.jar</code> and call a method on this controller, I no longer see the message <code>Resolved [foo.bar.InvalidEntityException: Error message.]</code> and my JSON response looks like this, with the message missing.</p>
  <pre><code>error: &quot;Bad Request&quot;
  message: &quot;&quot;
  path: &quot;/resource/request&quot;
  status: 400
  timestamp: &quot;2021-06-06T04:12:39.759+00:00&quot;
  </code></pre>
  <p>What is the difference between running my springboot application from <code>mvnw spring-boot:run</code> to running the .jar? I want the same behaviour where error messages are resolved</p>