google safebrowsing api java client is giving: java.io.IOException: insufficient data written

172 views
Skip to first unread message

Priyanka Tanvani

unread,
Jan 11, 2017, 12:50:16 PM1/11/17
to google-api-java-client

When i'm using the google safebrowsing api through the google java client for the same(https://developers.google.com/resources/api-libraries/documentation/safebrowsing/v4/java/latest/) it is working fine when I'm trying to make one api request at a time.

Now, i'm trying to make simultaneous requests for full hashes using the java ExecutorService threadpool, i'm getting the following error :


java.io.IOException: insufficient data written
 at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.close(HttpURLConnection.java:3501)
 at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:81)
 at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981)
 at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
 at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
 at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
 at net.media.safeBrowsing.request.FindFullHashesApiRequest.makeRequest(FindFullHashesApiRequest.java:35)
 at net.media.safeBrowsing.util.FindFullHashesCallable.retryRequest(FindFullHashesCallable.java:35)
 at net.media.safeBrowsing.util.FindFullHashesCallable.call(FindFullHashesCallable.java:29)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)


I'm adding around 5000 prefixes in each findFullHashes request in both cases(single request at a time and multithreading). Can anyone please point out my mistake? 

Reply all
Reply to author
Forward
0 new messages