title: com.sun.jersey.api.client.ClientHandlerException: java.io.IOException: Premature EOF
body: <p>I am using jersey api client to call REST based webservice (this service is hosted in my localhost). When I call </p>
  
  <pre><code>String entity = (client response object here).getEntity(String.class);
  </code></pre>
  
  <p>I get below exception:</p>
  
  <pre><code>Caused by: java.io.IOException: Premature EOF
      at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) ~[?:1.7.0_71]
      at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609) ~[?:1.7.0_71]
      at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696) ~[?:1.7.0_71]
      at java.io.FilterInputStream.read(FilterInputStream.java:133) ~[?:1.7.0_71]
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3053) ~[?:1.7.0_71]
      at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) ~[?:1.7.0_71]
      at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) ~[?:1.7.0_71]
      at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) ~[?:1.7.0_71]
      at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[?:1.7.0_71]
      at java.io.Reader.read(Reader.java:140) ~[?:1.7.0_71]
      at com.sun.jersey.core.util.ReaderWriter.readFromAsString(ReaderWriter.java:171) ~[jersey-core-1.17.jar:1.17]
      at com.sun.jersey.core.util.ReaderWriter.readFromAsString(ReaderWriter.java:157) ~[jersey-core-1.17.jar:1.17]
      at com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider.readFromAsString(AbstractMessageReaderWriterProvider.java:114) ~[jersey-core-1.17.jar:1.17]
      at com.sun.jersey.core.impl.provider.entity.StringProvider.readFrom(StringProvider.java:73) ~[jersey-core-1.17.jar:1.17]
      at com.sun.jersey.core.impl.provider.entity.StringProvider.readFrom(StringProvider.java:58) ~[jersey-core-1.17.jar:1.17]
      at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:565) ~[jersey-client-1.17.jar:1.17]
      ... 59 more
  </code></pre>
  
  <p>I know that my webserive is giving me <code>200 OK</code> response. See the json response obtained from the REST based webserive :</p>
  
  <pre><code>  {"user_likes":[],"status_code":200,"status_msg":"OK"}
  
  Here is the response of my webservie:-
  
  * Adding handle: conn: 0x7fee13808c00
  * Adding handle: send: 0
  * Adding handle: recv: 0
  * Curl_addHandleToPipeline: length: 1
  * - Conn 0 (0x7fee13808c00) send_pipe: 1, recv_pipe: 0
  * About to connect() to localhost port 8080 (#0)
  *   Trying ::1...
  * Connected to localhost (::1) port 8080 (#0)
  &gt; GET /social/69124/likes/?comic_uuids=ccd48dca-955f-4ad4-838e-aa558b86679d,ff201290-1f92-4b13-bf11-20b61500a9aa,f1e77de0-0c75-4f0c-8515-7fa90e9a6baa,11e19c81-9e74-4a96-a34f-9696c3ab4a4e,152a624e-e06b-47ed-83bc-75ce26ce4a13,e9f0e9d6-5e35-4012-a7a9-6c37d5781205,7c718479-d8ed-4b67-9584-1647c34c08f2,4febbdde-8ab7-4127-b178-6c91f58deab5,ad583bc5-17d6-4982-9412-26fadfb8e261,1a53e323-5577-49a3-8151-a39a75084636 HTTP/1.1
  &gt; User-Agent: curl/7.30.0
  &gt; Host: localhost:8080
  &gt; Accept: */*
  &gt; 
   HTTP/1.1 200 OK
  * Server Apache-Coyote/1.1 is not blacklisted
  &lt; Server: Apache-Coyote/1.1
  &lt; Access-Control-Allow-Origin: *
  &lt; Content-Type: application/json;charset=utf-8
  &lt; Transfer-Encoding: chunked
  &lt; Date: Wed, 13 Apr 2016 10:28:51 GMT
  &lt; 
  * transfer closed with outstanding read data remaining
  * Closing connection 0
  curl: (18) transfer closed with outstanding read data remaining
  {"user_likes":[],"status_code":200,"status_msg":"OK"}
  </code></pre>
  
  <p>Please help me in this regard.</p>