title: Java REST service accepts POJO, but fields are always null
body: <p>I have a REST service that uses a POJO.  Here is the method:</p>
  
  <pre><code>@POST
  @Path("terminate")
  @Produces({"application/xml", "application/json"})
  @Consumes({"application/xml", "application/json"})
  public TerminateActorCommand terminateActor(TerminateActorCommand cmd) {
      System.out.println("Running terminate: " + cmd);
      Query query = em.createNamedQuery("Actor.terminate");
      query.setParameter("eid", cmd.getActorEid());
      query.executeUpdate();
      return cmd;
  }
  </code></pre>
  
  <p>Here is the POJO</p>
  
  <pre><code>import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import java.util.Date;
  import javax.xml.bind.annotation.XmlRootElement;
  
  /**
   *
   * @author mike
   */
  @XmlRootElement
  public class TerminateActorCommand {
  
      String actorEid;
      String terminatorEid;
      String reason;
      Date effectiveTerminationDate;
  
      public TerminateActorCommand() {
      }
  
      @JsonCreator
      public TerminateActorCommand(@JsonProperty("actorEid") String actorEid, @JsonProperty("terminatorEid") String terminatorEid,
              @JsonProperty("reason") String reason) { //, @JsonProperty("effectiveTerminationDate") Date effectiveTerminationDate) {
          this.actorEid = actorEid;
          this.terminatorEid = terminatorEid;
          this.reason = reason;
          //this.effectiveTerminationDate = effectiveTerminationDate;
      }
  
      public CommandType getCommandType() {
          return CommandType.TERMINATE_ACTOR;
      }
  
      public String getActorEid() {
          return actorEid;
      }
  
      public String getTerminatorEid() {
          return terminatorEid;
      }
  
      public String getReason() {
          return reason;
      }
  
      public Date getEffectiveTerminationDate() {
          return effectiveTerminationDate;
      }
  
      @Override
      public String toString() {
          return "TerminateActorCommand{" + "actorEid=" + actorEid + ", terminatorEid=" + terminatorEid + ", reason=" + reason + ", effectiveTerminationDate=" + effectiveTerminationDate + '}';
      }
  }
  </code></pre>
  
  <p>When I call this with CURL:</p>
  
  <pre><code>curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"actorEid":"mb995a", "terminatorEid":"mb995a","reason":"testing"}' http://127.0.0.1:8080/actor-service/webresources/net.mikeski.auth.entities.actors/terminate
  </code></pre>
  
  <p>I get the return value and see the print statement,but the TerminationCommand's fields are all null.  I get an instantiated object but the JSON I'm sending does not get populated on the object.</p>
  
  <p>Why???</p>
  
  <p>Here's the output:</p>
  
  <blockquote>
    <blockquote>
      <p>Info:   Running terminate: TerminateActorCommand{actorEid=null, terminatorEid=null, reason=null, effectiveTerminationDate=null}</p>
    </blockquote>
  </blockquote>