title: How do I enable automatic JSON marshalling in Jersey using autodiscovery?
body: <p>I'm trying to create a very simple example rest service that produces JSON. My understanding is that Jersey should auto discover the Jackson libraries (if they're on the classpath) and the JSON marshalling should happen automatically.</p>
  
  <p>The following error is reported when I call GET. Am I using the appropriate dependencies for this to work or am I missing something more fundamental?</p>
  
  <pre><code>SEVERE: MessageBodyWriter not found for media type=application/json, type=class jsonex.Person, genericType=class jsonex.Person.
  </code></pre>
  
  <p><strong>Dependencies</strong></p>
  
  <p>I'm using Gradle with the gretty plugin applied and these dependencies:</p>
  
  <pre><code>dependencies {
      compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2+'
      runtime group: 'org.glassfish.jersey.containers', name: 'jersey-container-servlet', version: '2.23'
      runtime group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: '2.7'
  }
  </code></pre>
  
  <p><strong>Application class</strong></p>
  
  <pre><code>package jsonex;
  
  import javax.ws.rs.ApplicationPath;
  import javax.ws.rs.core.Application;
  import java.util.Collections;
  import java.util.Set;
  
  @ApplicationPath ("services")
  public class PersonApp extends Application {
  
      @Override
      public Set&lt;Object&gt; getSingletons() {
          return Collections.singleton(new PersonService());
      }
  }
  </code></pre>
  
  <p><strong>Service class</strong></p>
  
  <pre><code>package jsonex;
  
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  
  @Path("people")
  public class PersonService {
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public Person getPerson() {
          Person me = new Person();
          me.setFirstName("Dave");
          me.setLastName("R");
          return me;
      }
  }
  </code></pre>
  
  <p><strong>POJO</strong></p>
  
  <pre><code>package jsonex;
  
  public class Person {
      String firstName, lastName;   
  
      public String getFirstName() {
          return firstName;
      }
  
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
      public String getLastName() {
          return lastName;
      }
  
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
  }
  </code></pre>
  
  <p>Thanks!</p>