I’m getting the socket is closed exception quite frequently when trying to call the graph api. Retrying after few seconds it works.
I’m using closeablehttpclient, httpresponse, httpentity.
I guess the problem arise when calling EntityUtils.tobyteArray(entity)
Please advice or suggest.
java.net.SocketException: Socket is closed
at com.ibm.jsse2.as.k(as.java:680)
at com.ibm.jsse2.e.read(e.java:3)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
at org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:261)
at org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:222)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:183)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:249)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:169)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:128)
at java.io.FilterInputStream.read(FilterInputStream.java:118)
at org.apache.http.client.entity.LazyDecompressingInputStream.read(LazyDecompressingInputStream.java:64)
at org.apache.http.util.EntityUtils.toByteArray(EntityUtils.java:138)