title: jersey server - convert json object request to model object
body: <p>I'm using mvc jersey server, I want to send some json object that contain two keys: 1. task 2.propertyComponent- jsonArray of propertyComponent objects.
  Here is my JsonObject request:</p>
  
  <pre><code>{"task":{"apartment":4,"actionTypeId":1,"comments":"","crDate":1467204343000,"crUser":"CRM","crmTaskId":"20160600056\/1","moduleId":1,"nActive":null,"nAppro":3,"nApproDetails":null,"nApproFdate":null,"nContar":3,"nContarDetails":null,"nDivided":3,"nDividedDetails":null,"nElectricity":3,"nEmpty":3,"nEmptyDetails":null,"nEmptyFdate":null,"nFloor":3,"nFloorFdate":null,"nFnType":3,"nFnUser":"","nKBusy":3,"nKBusyDetails":null,"nKItem":3,"nKItemDetails":null,"nKType":null,"nKTypeDetails":null,"nKUse":3,"nKUseDetails":null,"nMeasure":3,"nMeasureDetails":null,"property":{"aSugNecesDetails":"מחסנים לשיווק","aZhuiPhisi":1111,"complot1":null,"complot2":null,"complot3":null,"latitude":32.0721694,"longitude":34.8780671,"meshalemName":"יוסי כהן","misparNecsiMishne":null,"rashutId":248,"taskId":2264,"ktovetNeces":"האדמור איפרגן 29\/4 ג","aezorMisim":0,"agodelNeces":100,"agushHelkaTat":638825614,"akarkaNeto":0,"amhutHaesek":0,"amisparHadarim":null,"amisparKomot":null,"asemelRehov":1314,"asemelYshuv":null,"ashemBaal":"נסיון שירן ניסיו ונ","ashetachBnia":0,"ashetachHelka":0,"asugNeces":14,"azehutBaal":87654323,"azhuiMeshalem":87654323},"nNonItem":null,"nNonItemDetails":null,"nOverhaul":3,"nOverhaulDetails":null,"nOverhaulFdate":null,"nOwnerp":3,"nPlumbing":3,"nPopulated":3,"nPopulatedFdate":null,"nRoof":3,"nSize":3,"nSubn":3,"nSubnDetails":null,"nToN":3,"nToNDetails":null,"nUsage":"1","nUsageDetails":null,"nWater":3,"rashutId":248,"taskDuedate":1467204343000,"taskDuedateP":1467204343000,"taskId":2264,"taskStatus":2,"taskType":2,"userId":"040634461","wPlanId":999999,"actionTypeName":"החלפת משלמים","workPlanName":"ללא שיוך","crmIncidentNum":null,"meetTime":null,"hour":null,"crmSpecifications":null,"executionDate":1494760023635,"crmReqName":"יוסי כהן","crmReqMobile":"054-5555555","crmReqHPhone":"035353855","crmReqWPhone":null,"address":null,"draft_ind":true,"image_required":true,"subPropertyInd":false,"minute":null,"userName":"עידו גפני","distance":31565},"propertyComponents":[{"taskId":2264,"rashutId":139,"cmpZihuyPhizi":"1111","cmpCode":"999","cmpName":"אחר","cmpLenght":20,"cmpWidth":10,"cmpTotal":200,"isRemoved":false},{"taskId":2264,"rashutId":139,"cmpZihuyPhizi":"1111","cmpCode":"999","cmpName":"אחר","cmpLenght":30,"cmpWidth":20,"cmpTotal":600,"isRemoved":false},{"taskId":2264,"rashutId":139,"cmpZihuyPhizi":"1111","cmpCode":"999","cmpName":"אחר","cmpLenght":40,"cmpWidth":30,"cmpTotal":1200,"isRemoved":false}]}
  </code></pre>
  
  <p>In my server side I created some request entity object:</p>
  
  <pre><code>@XmlRootElement
  @JsonIgnoreProperties(ignoreUnknown = true)
  public class taskWithPropertyComponentResponse {
  
      private List&lt;propertyComponent&gt; propertyComponents;
      private Task task;
  
      @JsonProperty("propertyComponents")
      public List&lt;propertyComponent&gt; getPropertyComponents() {
                  return propertyComponents;
      }
      public void setPropertyComponents(List&lt;propertyComponent&gt; propertyComponents) {
                  this.propertyComponents = propertyComponents;
      }
  
      @JsonProperty("task")
      public Task getTask() {
          return task;
      }
      public void setTask(Task task) {
          this.task = task;
      }
  
  
  
  }
  </code></pre>
  
  <p>This is <strong>propertyComponent</strong> model:</p>
  
  <pre><code>    String id;
      String taskId;
      String rashutId;
      String cmpZihuyPhizi;
      String cmpCode;
      String cmpName;
      double cmpLenght;
      double cmpWidth;
      double cmpTotal;
      boolean isRemoved;
  </code></pre>
  
  <p>When I send client request with this json I get 401 error, 
  What can I do to resolve this issue?
  How can I send jsonArray to server using jersey?</p>
  
  <p>Thanks!</p>