English 中文(简体)
页: 1
原标题:Google Drive SDK - Java sample not working

I m trying to get familiar with the Google Drive API using the official Java sample. However, after wasting a few hours and attempting to set the sample up two times, I m still not able to use it as expected.

它不展示档案内容,反而在文件Servlet(/svc路)上犯了404个错误。 更具体地说,service.files(.get(fileId).execute(>);似乎将无效。 我用不同的档案、不同的监查系统类型,直接从谷歌驱动,并使用谷歌文档皮cker。

I ve沿用了所述步骤。 尽可能密切。

是否有任何人能够进行抽样调查?

edit: Here s the log output of the FileServlet when requesting the URL /svc?file_id=0B08R9MrOE-ejZTY2M2I5MjAtYmVjZS00OTkyLWI4ZTEtOTg4OGM3YTIxMWEw (the 404 error is thrown at line 78):

2012-04-26 08:21:36.077
com.google.api.client.http.HttpRequest execute: -------------- REQUEST  --------------
GET https://www.googleapis.com/drive/v1/files/0B08R9MrOE-ejZTY2M2I5MjAtYmVjZS00OTkyLWI4ZTEtOTg4OGM3YTIxMWEw
Accept-Encoding: gzip
User-Agent: Google-HTTP-Java-Client/1.8.3-beta (gzip)

D 2012-04-26 08:21:36.263
com.google.api.client.http.HttpResponse <init>: -------------- RESPONSE --------------
403 OK
content-type: application/json; charset=UTF-8
content-encoding: gzip
date: Thu
date: 26 Apr 2012 06:21:36 GMT
expires: Thu
expires: 26 Apr 2012 06:21:36 GMT
cache-control: private
cache-control: max-age=0
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
content-length: 188
server: GSE
x-google-cache-control: remote-fetch
via: HTTP/1.1 GWA

D 2012-04-26 08:21:36.265
com.google.api.client.http.HttpResponse getContent: Response size: 188 bytes
D 2012-04-26 08:21:36.271
com.google.api.client.http.HttpResponse getContent: {
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "dailyLimitExceededUnreg",
    "message": "Daily Limit Exceeded. Please sign up",
    "extendedHelp": "https://code.google.com/apis/console"
   }
  ],
  "code": 403,
  "message": "Daily Limit Exceeded. Please sign up"
 }
}

很多东西如“我不知道你”给我,因此,我对我的客户身份识别和客户保密再次进行了研究:我已注意到,有2个客户身份和客户秘密在APIC Console、1个“用于网络应用的Client ID”和1个“用于SDK的Client ID”上出现。 我曾用过这颗卫星进行网络应用,因此,我试图把这颗卫星转至K号车道。 不幸的是,这丝毫没有改变。 2. 错误......:

最佳回答

I eventually managed to get it working. I m not sure what was the problem before, but here are some tips for those who are facing similar problems:

  • “Client ID for web application”和“Client ID for Drive SDK”混淆了我。 遗憾的是,文件没有告诉你什么地方使用,但似乎像你一样需要“网络应用的识别”。

  • 如果你更新你的“ Chrome号”或“APIC”号。 例如,改变Auth客户身份,将奥阿瑟客户身份列入AAP console可能需要一些时间才能生效,因为每个人都会打猎。 如果你正在测试你的申请,删除海滩和厨师有助于加快这一进程。

顺从你们的申请,感谢帮助我的人!

问题回答

在我的经验中,“403个配额被免除”总是来自于《吉大港伙伴关系授权书》的负责人,而后者则不是固定的。

我使用了谷歌红.样本中分发的java OAuth代码,用于一个通过“开放”流动的方案,同样也弥补了403个错误。

我不得不向《奥乌特法典》提出问题,我在其他地方就403个错误提到了这一问题的根源。 基本上,CredentialMediator的汇率办法假定只有一个方向,这是你希望去的。 这对我来说是一例,导致了一部《外汇法》。

为了解决你可以把客户的圈子清单集中起来——这样,你希望首先或部分这样做,但是如果这种方法能够触及到其中的任何一种圈子,就需要有参数。

我希望这帮助人们根除了403 gr。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签