title: getting SEVERE: MessageBodyWriter not found for media type=application/json, type=class org.json.JSONObject
body: <p>I am just writing a client method and invoking the POST method. But i am facing the below error.</p>
  
  <p>When i test the webservices url though postman its working. Only in my client code its giving error.</p>
  
  <p>Mar 29, 2016 5:39:27 PM        org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor aroundWriteTo
  SEVERE: MessageBodyWriter not found for media type=application/json, type=class org.json.JSONObject, genericType=class org.json.JSONObject.
  Exception in thread "main" org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyWriter not found for media type=application/json, type=class org.json.JSONObject, genericType=class org.json.JSONObject.
      at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:247)
      at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
      at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
      at org.glassfish.jersey.client.ClientRequest.doWriteEntity(ClientRequest.java:517)
      at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:499)
      at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:388)
      at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
      at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255)
      at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:700)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
      at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:696)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:349)
      at test.restful.webservices.TESTClient.testUpdateUser(TESTClient.java:58)
      at test.restful.webservices.TESTClient.main(TESTClient.java:89)</p>
  
  <p>Here is my Code: </p>
  
  <pre><code>  private void testUpdateUser(){
        FormBean sample = new FormBean();  
        sample.setFORM_LONG_DESC("FrmIssCMNEW");       
        JSONObject jo = new JSONObject(sample);
        System.out.println("Json ===&gt;&gt;"+jo);
        String callResult = client
            .target(REST_SERVICE_URL)
            .path("/Add")
            .queryParam("formcode", "FrmIssCMNEW")
            .queryParam("dsnID","OFSBGRC")
            .queryParam("version","1")
            .queryParam("longdesc","testing by me")
           .request(MediaType.TEXT_PLAIN)
           .post(Entity.entity(jo,MediaType.APPLICATION_JSON),
              String.class);
  
    Post Method:
    @POST
    @Produces(MediaType.TEXT_PLAIN)   
    @Path("/Add")
    public String save
    (     @QueryParam("formcode") String formcode,
          @QueryParam("version") int version,
          @QueryParam("dsnID") String dsnID,
          @QueryParam("longdesc") String longdesc)
      {   
         /* my code */
             return "Display from POST method  &lt;&gt; "+"FormID :"+fb.getFORM_ID()+" --&gt;&gt; FormLong Description :"+fb.getFORM_LONG_DESC();
  
     }
  </code></pre>
  
  <p>Thanks In Advance.</p>