一部のクエリでは、応答を待機する の10秒後にこのServiceExceptionを受け取ります。DocumentList API FullTextQuery ServiceException - 不明なエラーが発生しました
私はまた、直接HTTP取得リクエストと同じ結果を試しました。
例:契約%20Colectiv%20de%20Munc%C4%83
1. My code:
URL feedUrl = new URL("https://docs.google.com/feeds/default/private/ full/folder%3A" + folderId + "/contents/-/pdf");
DocumentQuery query = new DocumentQuery(feedUrl);
query.setFullTextQuery(searchText);
client.setConnectTimeout(0);// with or without this line I receive the same result (I also put 30000 value - same result)
client.setReadTimeout(0);// with or without this line I receive the same result
DocumentListFeed feed = client.getFeed(query, DocumentListFeed.class);
2. This is the stacktrace for the exception that I receive with documentlist api query:
com.google.gdata.util.ServiceException: An unknown error has occurred.
<errors xmlns='http://schemas.google.com/g/2005'>
<error><domain>GData</domain><code>ServiceException</code>
<internalReason>An unknown error has occurred</internalReason>
</error></errors>
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:624)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java: 552)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java: 530)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
at com.google.gdata.client.Service.getFeed(Service.java:1135)
...
3. This is the exception I receive with direct http get request:
java.io.IOException: Server returned HTTP response code: 500 for URL: https://docs.google.com/feeds/default/private/full/folder%3[my_folder_doc-id]/contents/-/pdf?q="[query_text]"&max-results=25
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java: 1436)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java: 379)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java: 318)
at GoogleDocsManager.googleSearch(GoogleDocsManager.java:281)
追加情報:
1. My folder contains almost 300k files. Could this be the problem?
2. In ~85% of searches I get the correct response()
3. In browser the same interogation returns "The server encountered an error. Please try again later", but after refresh works fine.
誰も私がこの問題の "回避策" を取得するために助けることができますか?またはどのように それを避けるには?
私はこの問題を数か月前のdocumentlist api groupに掲載しましたが、このグループは読み取り専用なのでこの問題に関する情報は得られません。
これは私が(〜10秒後に)直接のHTTPリクエストで取得500応答である:
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>ServiceException</code>
<internalReason>An unknown error has occurred.</internalReason>
</error>
</errors>
これはコードです:問題を持つ
URL feedUrl = new URL("https://docs.google.com/feeds/default/private/full/folder%3A" + folderId + "/contents/-/pdf?max-results=25&q=" + searchText);
HttpURLConnection copyHttpUrlConn = (HttpURLConnection) feedUrl.openConnection();
copyHttpUrlConn.setDoOutput(true);
copyHttpUrlConn.setRequestMethod("GET");
copyHttpUrlConn.setRequestProperty("GData-Version", "3.0");
copyHttpUrlConn.setRequestProperty("Authorization", "GoogleLogin auth=" + authToken);
int respCode = copyHttpUrlConn.getResponseCode();
System.out.println("Response code: " + respCode);
InputStreamReader isr = null;
if(respCode != 200){
isr = new InputStreamReader(copyHttpUrlConn.getErrorStream());
}
else{
isr = new InputStreamReader(copyHttpUrlConn.getInputStream());
}
BufferedReader br = new BufferedReader(isr);
String line = null;
while((line = br.readLine()) != null){
System.out.println(line);
}
他の最近のクエリ:
- タイトル:2012-05「exceptii de neconstitut ionalitate刑事」
- "litigiiデmunca"
- "MOScrăciunsrlの"
- "BIL terenuri SAブカレストあなたがフェッチ考えることができます回避策として、"
- "ordonanta・デ・プラタ"
ダイレクトリクエストで受け取った500応答の本文を印刷してみましたか?それはおそらくあなたに問題の詳細を教えてくれるでしょう。また、Google Docsには真剣に300,000の文書がありますか? –
こんにちはNick、 はい、私は300k(96 GB)のファイルを持っています。その95%は小さなpdfファイルです。これが問題なのでしょうか? (*)500件の返信を私の質問に返信します。 –