title: JAX-RS Jersey JSON GET HTTP Status 500 Internal Server Error
body: <p>I'm learning JAX-RS and I'm getting a HTTP Status 500 Internal Server Error when making a GET request which produces JSON. XML works fine.</p>
  
  <p>I've searched other questions but can't find a solution. This may be down to my current lack of knowledge. However, from what I have read there is a suggestion that my project is missing a JAR in the build path.</p>
  
  <p>I'm not using Maven. I've just created a dynamic web app in Eclipse and added the JAX-RS / Jersey jars to my WEB-INF/lib directory and added them to my build path.</p>
  
  <p>I'm using Postman to test the web service. I'm adding Accept to the header when making the requests:</p>
  
  <p>Accept : application/xml - works fine. 
  Accept : application/json - Internal Server Error</p>
  
  <p>Here's my (very simple code) code:</p>
  
  <pre><code>@XmlRootElement
  public class Thing {
  
      private String name;
  
      public Thing(){}
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
  }
  </code></pre>
  
  <p>The service is set up to produce both XML and JSON.</p>
  
  <pre><code>@Path("/get")
  public class Service {
  
      @GET
      @Path("/both")
      @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
      public Thing getThingResponses(){
  
          Thing t = new Thing();
          t.setName("I'm a thing!");
          return t;
  
      }
  
  
  }
  </code></pre>
  
  <p>Any help / pointers will be appreciated. Thanks</p>