title: JAX-RS: How can I return my list of objects as JSON?
body: <p>I looked at the documentation of <a href="http://wiki.fasterxml.com/JacksonInFiveMinutes" rel="nofollow noreferrer">Jackson</a>, and it left me confused :(
  My entity looks like  :</p>
  
  <pre><code> @Entity
   @Table(name = "variable")
   public class Variable {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private long id;
  
      @Column(unique = true, nullable = false)
      private String name;
  
      @Column
      @Enumerated(EnumType.STRING)
      private VariableType type;
  
      @Column(nullable = false)
      private String units;
  
      @Temporal(TemporalType.TIMESTAMP)
      @Column(name = "created_on", nullable = false)
      private Date createdOn;
  
      @Temporal(TemporalType.TIMESTAMP)
      @Column(name = "retired_on", nullable = true)
      private Date retiredOn;
  
      @Column(nullable = false)
      private boolean core;
  
  }
  </code></pre>
  
  <p>and my <code>JAX-RS</code> service looks like  </p>
  
  <pre><code>@Path("/variable")
  public class VariableResource {
      @Inject private VariableManager variableManager;
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public Response getVariables() {
          return Response.ok(variableManager.getVariables()).build();
      }
  
  }
  </code></pre>
  
  <p>When I test this service using <code>curl http://localhost:8080/app/rest/variable</code>, I see the following in my server logs  </p>
  
  <pre><code>[javax.ws.rs.core.Application]] (http--127.0.0.1-8080-6) Servlet.service() for servlet javax.ws.rs.core.Application threw exception: java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.&lt;init&gt;(Ljava/lang/Class;)V
  </code></pre>
  
  <p>What are some simplest ways I can return my list of variables as JSON?</p>