title: Unable to send Response from Rest method
body: <p>Here is the rest ws POST method code:</p>
  
  <pre><code>        @POST 
          @Path("/json/saveuser")
          @Consumes("application/json")
          public ResponseBuilder saveUserJSON(User user) {
              if (save(user)) {
                  return Response.status(HttpStatus.SC_OK);
              }
              return Response.status(HttpStatus.SC_BAD_REQUEST);
          }
  </code></pre>
  
  <p><strong>User is saved properly in DB.</strong> </p>
  
  <p>But the line <code>Response.status(HttpStatus.SC_OK);</code> and <code>Response.status(HttpStatus.SC_BAD_REQUEST);</code>, is throwing below error:</p>
  
  <pre><code>Mar 06, 2015 1:38:49 PM com.sun.jersey.spi.container.ContainerResponse traceException
  SEVERE: Mapped exception to response: 500 (Internal Server Error)
  javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class com.sun.jersey.core.spi.factory.ResponseBuilderImpl, and Java type class javax.ws.rs.core.Response$ResponseBuilder, and MIME media type application/octet-stream was not found
      at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:278)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1326)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
      at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class com.sun.jersey.core.spi.factory.ResponseBuilderImpl, and Java type class javax.ws.rs.core.Response$ResponseBuilder, and MIME media type application/octet-stream was not found
      ... 28 more
  </code></pre>
  
  <p>Did googling. And according to the posts in SO and other sites, added the jars as listed below (Some additional jars are also added for other dependency):</p>
  
  <pre><code>antlr-2.7.7.jar
  com.sun.jersey.jersey-core-1.4.0.jar
  com.sun.jersey.jersey-server-1.4.0.jar
  dom4j-1.6.1.jar
  gcm.server.jar
  genson-0.98.jar
  hibernate-commons-annotations-4.0.5.Final.jar
  hibernate-jpa-2.1-api-1.0.0.Final.jar
  http-core-4.1.jar
  jackson-all-1.9.0.jar
  jackson-annotations-2.2.2.jar
  jackson-core-2.2.2.jar
  jandex-1.1.0.Final.jar
  javassist-3.18.1-GA.jar
  jboss-logging-3.1.3.GA.jar
  jboss-logging-3.1.4.GA.jar
  jboss-logging-annotations-1.2.0.Beta1.jar
  jboss-transaction-api_1.2_spec-1.0.0.Final.jar
  jersey-bundle-1.8.jar
  jersey-container-servlet-core-2.16.jar
  jersey-core-1.15.jar
  jersey-json.jar
  json_simple-1.1.jar
  lucene-core-4.10.4.jar
  mysql-connector-java-5.1.31.jar
  slf4j-api-1.6.1.jar
  xml-apis-1.3.03.jar
  </code></pre>
  
  <p><strong>Not sure what am I missing? Any suggestion?</strong></p>