title: Converting ZonedDateTime type to Gson
body: <p>I have rest service that return arraylist of object,and I have implemented jersy restful client to execute it,but I have problem in converting ZonedDateTime type to json so I get this error </p>
  
  <pre><code> Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 231 path $[0].lastmodifieddate
  </code></pre>
  
  <p>How can i fix this problem?</p>
  
  <p>lastmodifieddate column in entity  </p>
  
  <pre><code> @Column(name = "lastmodifieddate")
   private ZonedDateTime lastmodifieddate;
  
   //getter and setter
  </code></pre>
  
  <p>rest service</p>
  
  <pre><code>@RequestMapping(value = "/getScoreFactor",
          method = RequestMethod.GET,
          produces = MediaType.APPLICATION_JSON_VALUE)
  @Timed
  public List&lt;Scorefactor&gt; getScoreFactor() throws JSONException {
      return scoreService.getScoreFactor();
  }   
  </code></pre>
  
  <p>jersy restful client</p>
  
  <pre><code>  try {
  
          Client client = Client.create();
          WebResource webResource = client
             .resource("http://localhost:8080/adap/api/getScoreFactor");
          ClientResponse response = webResource.accept("application/json")
                     .get(ClientResponse.class);
  
          String output =  response.getEntity(String.class);
  
          System.out.println("output--"+output);
          Type listType =  new TypeToken&lt;List&lt;Scorefactor&gt;&gt;() {}.getType();
  
          List&lt;Scorefactor&gt; scorefactors = new Gson().fromJson(output,listType);
  
          System.out.println(scorefactors);
  
      } catch (Exception e) {
  
          e.printStackTrace();
  
  }    
  </code></pre>