我正在尝试让 Java DrEdit 示例在 GAE 上运行完全,如 instructions 中所述。 。我已经达到了这样的程度:我可以从文档创建一个新的“dredit”文档,允许身份验证并访问实际的应用程序,但我在 GAE 日志中得到了返回到 gdrive 的每个操作的信息:
Uncaught exception from servlet
com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 OK
{
"code" : 401,
"errors" : [ {
"domain" : "global",
"location" : "Authorization",
"locationType" : "header",
"message" : "Login Required",
"reason" : "required"
} ],
"message" : "Login Required"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:159)
我在 7 日所做的与说明不同的地方:
In the Eclipse Build Path editor for the project, add all of the JARs in the war/WEB-INF/lib/ directory to the project's build path.
我也在 lib/dependency 下添加了库,只是添加了 lib 就留下了编译错误。
最佳答案
DrEdit Java 中存在一个错误,导致其发布,本质上是跳过了 token 是否丢失的检查。修复此错误的相关更改是 here .
我认为应用该更改将为您解决问题。我还更新了此示例的指南。
关于java - Google Drive SDK DrEdit Java 版本返回 401 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10354701/