title: XML returns as default instead of JSON rest service
body: <p>I have a rest api that supports returning both XML and JSON as follows:</p>
  
  <pre><code>@GET
      @Path("/areas/city/{cityId}")
      @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
      public Response getAreaByCity(@PathParam("cityId") String cityId) {
          List&lt;Area&gt; areaList = //service call to get area
          GenericEntity&lt;List&lt;Area&gt;&gt; areaEntityList = new GenericEntity&lt;List&lt;Area&gt;&gt;(areaList) {};
          return Response.ok(areaEntityList).build();
      }
  </code></pre>
  
  <p>The above returns XML as default if no Accept header is defined.I want to return JSON instead..so as per the post <a href="https://stackoverflow.com/questions/24257314/produces-annotation-in-jax-rs">@Produces annotation in JAX-RS</a>, I changed my service to provide quality factor. But again XML is returned by default. 
  After thinking for some time, I see <code>Area</code> class which is being used is marked with <code>@XmlRootElement</code>. Is this causing issue? If yes, how to resolve it? If not, how can i return JSON as default.</p>