anupam409 / google-api-translate-java

Automatically exported from code.google.com/p/google-api-translate-java
0 stars 0 forks source link

Google translate exception only on specific AP. #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi we are working on Android mobile to use Google translate.

Same text and language settings are working well with other 3G network or WiFi, 
but it always fails with some WiFi AP.

Here is error from google-api-translate-java. Could someone check this errors???

02-15 17:17:44.668  4474  4474 W System.err: java.lang.Exception: 
[google-api-translate-java] Error retrieving translation.
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.google.api.GoogleAPI.retrieveJSON(GoogleAPI.java:96)
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.google.api.detect.Detect.execute(Detect.java:56)
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.tecace.app.im.ImChatView.translate_sendMessage(ImChatView.java:2636)
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.tecace.app.im.ImChatView.sendMessage(ImChatView.java:1699)
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.tecace.app.im.ImChatView.sendMessage(ImChatView.java:1688)
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.tecace.app.im.ImChatView$9.onClick(ImChatView.java:582)
02-15 17:17:44.668  4474  4474 W System.err:    at 
android.view.View.performClick(View.java:2538)
02-15 17:17:44.668  4474  4474 W System.err:    at 
android.view.View$PerformClick.run(View.java:9152)
02-15 17:17:44.668  4474  4474 W System.err:    at 
android.os.Handler.handleCallback(Handler.java:587)
02-15 17:17:44.668  4474  4474 W System.err:    at 
android.os.Handler.dispatchMessage(Handler.java:92)
02-15 17:17:44.668  4474  4474 W System.err:    at 
android.os.Looper.loop(Looper.java:123)
02-15 17:17:44.668  4474  4474 W System.err:    at 
android.app.ActivityThread.main(ActivityThread.java:3647)
02-15 17:17:44.668  4474  4474 W System.err:    at 
java.lang.reflect.Method.invokeNative(Native Method)
02-15 17:17:44.668  4474  4474 W System.err:    at 
java.lang.reflect.Method.invoke(Method.java:507)
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:982)
02-15 17:17:44.668  4474  4474 W System.err:    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:740)
02-15 17:17:44.668  4474  4474 W System.err:    at 
dalvik.system.NativeStart.main(Native Method)
02-15 17:17:44.668  4474  4474 W System.err: Caused by: java.lang.Exception: 
[google-api-translate-java] Error reading translation stream.
02-15 17:17:44.673  4474  4474 W System.err:    at 
com.google.api.GoogleAPI.inputStreamToString(GoogleAPI.java:154)
02-15 17:17:44.673  4474  4474 W System.err:    at 
com.google.api.GoogleAPI.retrieveJSON(GoogleAPI.java:86)
02-15 17:17:44.673  4474  4474 W System.err:    ... 16 more
02-15 17:17:44.673  4474  4474 W System.err: Caused by: java.io.IOException: 
BufferedInputStream is closed
02-15 17:17:44.673  4474  4474 W System.err:    at 
java.io.BufferedInputStream.streamClosed(BufferedInputStream.java:116)
02-15 17:17:44.673  4474  4474 W System.err:    at 
java.io.BufferedInputStream.read(BufferedInputStream.java:274)
02-15 17:17:44.673  4474  4474 W System.err:    at 
org.apache.harmony.luni.internal.net.www.protocol.http.UnknownLengthHttpInputStr
eam.read(UnknownLengthHttpInputStream.java:40)
02-15 17:17:44.673  4474  4474 W System.err:    at 
java.io.InputStreamReader.read(InputStreamReader.java:255)
02-15 17:17:44.673  4474  4474 W System.err:    at 
java.io.BufferedReader.fillBuf(BufferedReader.java:128)
02-15 17:17:44.673  4474  4474 W System.err:    at 
java.io.BufferedReader.readLine(BufferedReader.java:357)
02-15 17:17:44.673  4474  4474 W System.err:    at 
com.google.api.GoogleAPI.inputStreamToString(GoogleAPI.java:149)
02-15 17:17:44.673  4474  4474 W System.err:    ... 17 more

Original issue reported on code.google.com by ws.ben....@gmail.com on 16 Feb 2011 at 2:49

GoogleCodeExporter commented 9 years ago
That's a little bit weird.

It's writing to the connection successfully but then failing to read the 
response back. If it's consistent I guess it might be some obscure underlying 
issue - writing to the connection is flushed before reading when i wonder if 
perhaps it should have been closed. I'll try and test a new version which does 
that when I get the opportunity to see if it works and then maybe you could try 
it and see if it has any affect.

If it's something else though, it might be virtually impossible for me to fix 
if I can't reproduce it.

Original comment by rich.mid...@gmail.com on 16 Feb 2011 at 7:14

GoogleCodeExporter commented 9 years ago
I have faced same situation at France.

Attached android platform log using 3G network.

Could you review the log for me? (Same exception)

Original comment by ws.ben....@gmail.com on 23 Feb 2011 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago
This happens always when I try to detect language.

Original comment by ws.ben....@gmail.com on 23 Feb 2011 at 2:45

GoogleCodeExporter commented 9 years ago
Could you attach it in a different format... zip or tar.gz maybe?

Original comment by rich.mid...@gmail.com on 23 Feb 2011 at 7:07

GoogleCodeExporter commented 9 years ago
ZIP file added

Original comment by ws.ben....@gmail.com on 24 Feb 2011 at 3:34

Attachments:

GoogleCodeExporter commented 9 years ago
There's a new version (0.95) which closes some streams a little differently. 
Whether it'll make any difference to this issue I don't know, but it might be 
worth a try.

Original comment by rich.mid...@gmail.com on 9 Mar 2011 at 9:28

GoogleCodeExporter commented 9 years ago

Original comment by rich.mid...@gmail.com on 5 Nov 2011 at 5:27