title: Using JERSEY and JACKSON to read in POST request data
body: <p>I'm getting an error of the following: </p>
  
  <blockquote>
    <p>Can not deserialize instance of java.util.ArrayList out of
    VALUE_STRING token</p>
  </blockquote>
  
  <p>when I send the following curl request locally:</p>
  
  <pre><code>&gt; curl -H "Content-Type: application/json" -d
  &gt; '{"url":"http://www.facebook.com", "whitelist":"[white,list]",
  &gt; "blacklist":"[black,list]"}' http://localhost:8080/
  </code></pre>
  
  <p>Here's my resource and representation class. All I'm doing is trying to taking in the POST request and toString()'ing the information so I can validate that its being read correct by Jackson and building the proper POJO. Am I missing other annotations?</p>
  
  <pre><code>@Path("/")
  public class ValidationRequestResource {
  
      @GET
      @Produces(value = MediaType.TEXT_PLAIN)
      public Response index() {
          System.out.println("calling index() method!");
          return Response.status(200).build();
      }
  
      @POST
      @Produces(value = MediaType.TEXT_PLAIN)
      @Consumes(value = MediaType.APPLICATION_JSON)
      public Response processValidationRequest(ValidationRequest validationRequest) {
          System.out.println("calling processValidationRequest() method");
          String output = validationRequest.toString();
          return Response.status(200).entity(output).build();
      }
  </code></pre>
  
  <p>and representation class:</p>
  
  <pre><code>package validation;
  
  import java.util.ArrayList;
  
  import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonProperty;
  
  public class ValidationRequest {
  
      private String url;
      private ArrayList&lt;String&gt; whitelist;
      private ArrayList&lt;String&gt; blacklist;
  
      @JsonCreator
  public ValidationRequest(@JsonProperty("url") String url, @JsonProperty("whitelist") ArrayList&lt;String&gt; whitelist, @JsonProperty("blacklist") ArrayList&lt;String&gt; blacklist) {
          this.url = url;
          this.whitelist = whitelist;
          this.blacklist = blacklist;
      }
  
      @JsonProperty
      public String getUrl() {
          return this.url;
      }
  
      @JsonProperty
      public void setUrl(String url) {
          this.url = url;
      }
  
      @JsonProperty
      public ArrayList&lt;String&gt; getWhitelist() {
          return this.whitelist;
      }
  
      @JsonProperty
      public void setWhitelist(ArrayList&lt;String&gt; whitelist) {
          this.whitelist = whitelist;
      }
  
      @JsonProperty
      public ArrayList&lt;String&gt; getBlacklist() {
          return this.blacklist;
      }
  
      @JsonProperty
      public void setBlacklist(ArrayList&lt;String&gt; blacklist) {
          this.blacklist = blacklist;
      }
  
      @Override
      public String toString() {
          return new StringBuffer("URL: ").append(this.getUrl())
                     .append(" Whitelist: ").append(this.getWhitelist())
                     .append(" Blacklist: ").append(this.getBlacklist())
                     .toString();
      }
  }
  </code></pre>