title: Enabling JSON using jersey and grizzly
body: <p>I am playing with Jersey hosted with Grizzly and want to be able to consume and produce JSON, however I am getting 500 from the server in get request and media type unsupported in POST
  my server code is</p>
  
  <pre><code>org.glassfish.jersey.server.ResourceConfig rc = new ResourceConfig();
      rc.packages("RestServer.controllers");
  
      final Map&lt;String, Object&gt; initParams = new HashMap&lt;String, Object&gt;();
      initParams.put("com.sun.jersey.config.property.packages", "rest");
      initParams.put("com.sun.jersey.api.json.POJOMappingFeature", "true");
  
      rc.addProperties(initParams);
  
      webServer = GrizzlyHttpServerFactory.createHttpServer(uri, rc, false);
  </code></pre>
  
  <p>my POJO is:</p>
  
  <pre><code>@XmlRootElement
  public class Dummy {
  
      private int id;
      private String name;
  
      public Dummy(int id, String name) {
          this.id = id;
          this.name = name;
      }
  
      @XmlElement(name="id")
      public int getId() {
          return id;
      }
  
      @XmlElement(name = "name")
      public String getName() {
          return name;
      }
  }
  </code></pre>
  
  <p>and controller</p>
  
  <pre><code>@Path("/Dummies")
  public class DummyController {
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public Response get() {
          System.out.println("Get");
          return Response.status(Status.OK)
              .entity(new Dummy(-1, "hello"))
              .build();
      }
  
      @POST
      @Consumes(MediaType.APPLICATION_JSON)
      public Response AddDummy(Dummy dummy) {
          return Response.status(Status.CREATED).entity(dummy).build();
      }
  }
  </code></pre>