EOFException when using google may have endpoints

I am using google cloud enpoints in my android application. When I make a mail call for my backend, I sometimes see an EOFException. This does not always happen. I get this error for 5% of my requests. In addition, it depends on the devices. Some devices show this error more than others. This is mistake? Is there any workaround?

These are the banks used by the point of the cloud,

google-api-client-1.14.1-beta.jar google-api-client-android-1.14.1-beta.jar google-http-client-1.14.1-beta.jar google-http-client-android-1.14.1-beta.jar google-http-client-gson-1.14.1-beta.jar google-oauth-client-1.14.1-beta.jar 

Stacktrace

 06-10 03:53:45.057: W/System.err(1460): at android.os.AsyncTask$2.call(AsyncTask.java:287) 06-10 03:53:45.057: W/System.err(1460): at java.util.concurrent.FutureTask.run(FutureTask.java:234) 06-10 03:53:45.057: W/System.err(1460): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 06-10 03:53:45.057: W/System.err(1460): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 06-10 03:53:45.057: W/System.err(1460): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 06-10 03:53:45.057: W/System.err(1460): at java.lang.Thread.run(Thread.java:856) 06-10 03:53:45.107: W/System.err(1460): Caused by: java.io.EOFException 06-10 03:53:45.167: W/System.err(1460): at libcore.io.Streams.readAsciiLine(Streams.java:203) 06-10 03:53:45.197: W/System.err(1460): at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573) 06-10 03:53:45.288: W/System.err(1460): at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821) 06-10 03:53:45.297: W/System.err(1460): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283) 06-10 03:53:45.397: W/System.err(1460): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495) 06-10 03:53:45.677: W/System.err(1460): at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134) 06-10 03:53:46.037: W/System.err(1460): at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37) 06-10 03:53:46.057: W/System.err(1460): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:95) 06-10 03:53:46.057: W/System.err(1460): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980) 06-10 03:53:46.097: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412) 06-10 03:53:46.198: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345) 06-10 03:53:46.198: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463) 06-10 03:53:46.247: W/System.err(1460): at com.androidapp.android.ServerUtilities.postMessage(ServerUtilities.java:154) 

Update all my banks to the latest,

 google-api-client-1.15.0-rc.jar google-api-client-android-1.15.0-rc.jar google-http-client-1.15.0-rc.jar google-http-client-android-1.15.0-rc.jar google-http-client-gson-1.15.0-rc.jar google-oauth-client-1.15.0-rc.jar 

Still facing the same error

Also tried to install

 System.setProperty("http.keepAlive", "false"); 

The error does not disappear.

+4
source share
1 answer

I get the same error, but with a different third-party OAuth2 provider. I switched to using ApacheHttpTransport and the problem disappeared.

0
source

Source: https://habr.com/ru/post/1485355/


All Articles