Google Cloud Endpoints EOFException

 kobe0390 发布于 2023-02-09 08:37

我在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

它只在调用非auth方法时有效.怎么解决?

我使用本地服务器.

1 个回答
  • 我在调用插入值时遇到了类似的问题.我有点不同,因为我没有使用身份验证,但是我得到了同样的例外.我正在使用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的演示应用程序.

    2023-02-09 08:42 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有