我在AppEngine中有以下方法:
@ApiMethod(name = "authed", path = "greeting/authed")
public HelloGreeting authedGreeting(User user) {
...
}
我在Android AsyncTask中的doInBackground方法:
HelloGreeting hg = null;
try {
hg = service.authed().execute();
} catch (IOException e) {
Log.d("error", e.getMessage(), e);
}
return hg;
我遇到了ff错误:
/_ah/api/.../v1/greeting/authed: java.io.EOFException
在logcat中:
Problem accessing /_ah/api/.../v1/greeting/authed. Reason: INTERNAL_SERVER_ERROR
at java.util.zip.GZIPInputStream.readUByte
at java.util.zip.GZIPInputStream.readUShort
at java.util.zip.GZIPInputStream.readUShort
仅在调用非身份验证方法时有效。如何解决?
我正在使用本地服务器。
调用插入值时遇到了类似的问题。我的略有不同,因为我没有使用身份验证,但是我遇到了同样的异常。我正在使用appengine-java-sdk-1.8.8。我能够进行其他终端调用,并出现此错误。我查看了生成的代码,在工作调用与非工作调用之间看到的区别是HttpMethod。失败的通话定义为"POST"
。我可以使用注释httpMethod=ApiMethod.HttpMethod.GET
中的@ApiMethod
注释属性来更改此设置。
@ApiMethod(httpMethod = ApiMethod.HttpMethod.GET, name = "insertUserArtist", path = "insertUserArtist")
然后,我重新生成了客户端代码,并且能够进行呼叫而不会感到恐惧EOFException
。我不确定为什么POST无法正常工作,但是将其更改为GET可以工作。这确实提出了一些问题,可以跨多少个数据发送并应该解决(可能是库问题)。我将研究创建一个演示应用程序以提交给Google。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句