Kalito1992 / google-api-translate-java

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

HTTP response code: 400 for URL: https://www.googleapis.com/...... #155

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. The running the example program
2.
3.

What is the expected output? What do you see instead?
Translated text. Instead I get the error pasted below.

What version of the product are you using? On what operating system?
V 0.97, SO Windows 7

Please provide any additional information below.

Exception in thread "main" com.google.api.GoogleAPIException: 
java.lang.Exception: [google-api-translate-java] Error retrieving translation.
        at com.google.api.translate.TranslateV2.execute(TranslateV2.java:68)
        at GoogleTranslate.main(GoogleTranslate.java:21)
Caused by: java.lang.Exception: [google-api-translate-java] Error retrieving 
translation.
        at com.google.api.GoogleAPI.retrieveJSON(GoogleAPI.java:99)
        at com.google.api.translate.TranslateV2.execute(TranslateV2.java:62)
        ... 1 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for 
URL: https://www.googleapis.com/language/translate/v2?key=zIgtQ
VIhdxCoK9Q&q=Bonjour+le+monde&target=en&source=fr
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
        at com.google.api.GoogleAPI.retrieveJSON(GoogleAPI.java:93)
        ... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for 
URL: 
https://www.googleapis.com/language/translate/v2?key=tQVIhdxCoK9Q&q=Bonjour+le+m
onde&target=en&source=fr
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
        at com.google.api.GoogleAPI.retrieveJSON(GoogleAPI.java:89)
        ... 2 more

Original issue reported on code.google.com by gdaryan...@gmail.com on 27 Nov 2011 at 12:37