title: Obtaining "MessageBodyWriter not found for media type=application/json" trying to send JSON object through JAX-RS web service
body: <p>I am trying to send a JSON object through a JAX-RS web service.
  My file web.xml is:</p>
  
  <pre><code>&lt;servlet&gt;
   &lt;description&gt;JAX-RS Tools Generated - Do not modify&lt;/description&gt;
   &lt;servlet-name&gt;JAX-RS Servlet&lt;/servlet-name&gt;
   &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
    &lt;init-param&gt;
  &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
  &lt;param-value&gt;it.notifire&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
  &lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt;
  &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;JAX-RS Servlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/jaxrs/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>The class that models the object I want to send is:</p>
  
  <pre><code>public class GPSCoordinate {
  
  private float latitudine;
  private float longitudine;
  
   public float getLatitudine() {
      return latitudine;
  }
  public void setLatitudine(float latitudine) {
       this.latitudine = latitudine;
  }
  public float getLongitudine() {
      return longitudine;
  }
  public void setLongitudine(float longitudine) {
      this.longitudine = longitudine;
  }
  }
  </code></pre>
  
  <p>The root class resource is:</p>
  
  <pre><code>@Path("position")
  public class Position {
  
      @Context
  private UriInfo context;
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public GPSCoordinate getHTML() {
  
          GPSCoordinate coord = new GPSCoordinate();
          coord.setLatitudine(90.45f);
          coord.setLongitudine(34.56f);
  
          return coord;
      }
  }
  </code></pre>
  
  <p>Now, when i try to access the service I point my browser to the following link</p>
  
  <pre><code>http://localhost:8080/Notifire/jaxrs/position
  </code></pre>
  
  <p>and i get the following error:</p>
  
  <p>message org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyWriter not found for media type=application/json</p>
  
  <p>In my WEB-INF/lib folder I have the last release of jersey JAX-RS implementation (jaxrs-ri-2.5.jar) and the jersey-json.jar archive.</p>
  
  <p>Any help would be much appreciated.</p>