简体   繁体   中英

Google drive API upload file exception

I'm developing web application using google drive api and app-engine. I added all required libraries and code. But I'm getting the following error when I try to upload/copy a file:

java.lang.NoSuchMethodError: com.google.appengine.api.urlfetch.HTTPResponse.getHeadersUncombined()Ljava/util/List;
at com.google.api.client.extensions.appengine.http.UrlFetchResponse.<init>(UrlFetchResponse.java:36)
at com.google.api.client.extensions.appengine.http.UrlFetchRequest.execute(UrlFetchRequest.java:75)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:964)
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.project.uf.server.services.GoogleDriveService.createDocument(GoogleDriveService.java:52)

I looked to source code of com.google.appengine.api.urlfetch.HTTPResponse and found that method getHeadersUncombined does exist. Please help to resolve this problem.

You've almost certainly installed mismatched api libraries and/or you're copying example code which refers to an out of date version of the library. The api client libraries have been through several revisions, with many breaking changes along the way.

I suggest you clean out all of your libraries and re-install. If you're using eclipse, you can use Add Google APIS to install the latest libraries for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM