title: Error while trying to make a request to my java web app java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
body: <p>Error while trying to make a HTTP request to my java web app
  i am new with Spring Rest, so I couldn't figure what is the error here , i am trying to send HTTP request that should return &quot;hello world&quot; Msg , but it display this error</p>
  <p>&quot; org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Faces Servlet] in context with path [] threw exception [Cannot call sendError() after the response has been committed] with root cause
  java.lang.IllegalStateException: Cannot call sendError() after the response has been committed &quot;</p>
  <p><strong>- here are the HTTP endpoint for &quot;/hello&quot;, placed in the RestController class</strong></p>
  <pre><code>  @GetMapping(&quot;/hello&quot;)
          public String hello_world()
          {
              return &quot;Hello-World&quot;;
          }
  </code></pre>
  <p><strong>- the web.xml config</strong></p>
  <pre><code> &lt;servlet&gt;
              &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
              &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/config/applicationContext.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
  &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/config/applicationContext.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/faces/**&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>