这个错误有点神秘。我有一个返回的 Google-Cloud-Endpoint 方法List<String>
。就在退出该方法之前,我将字符串的内容记录为
LOG.info(“list has: " + results);
当我查看 app-engine 的日志时,我看到了打印输出。
现在在 android 端,我将内容读取为
StringCollection collection = service.getResults().execute();
根据android LogCat,这一行正在引发异常,归咎于服务器返回500错误:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
{
"code": 500,
"errors": [
{
"domain": "global",
"message": "Internal Error",
"reason": "internalError"
}
],
"message": "Internal Error"
}
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1045)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at com.business.game.pack.ServerCall$2.doInBackground(ServerCall.java:189)
at com.business.game.pack.ServerCall$2.doInBackground(ServerCall.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
我不确定如何修复此错误,因为它似乎超出了我的实际代码。
其他尝试:
用于返回的端点CollectionResponse.<String> builder().setItems(results).build()
。我将其更改为简单result
的故障排除,但这没有帮助。所以现在方法签名(仍然失败)是
@ApiMethod(name = "getResults", httpMethod = HttpMethod.GET)
public List<String> getResults() {
LOG.info(“Into getResults");
//… more code
LOG.info(“list has: " + results);
return results;// CollectionResponse.<String> builder().setItems(results).build();
}
谢谢你的帮助。