简体   繁体   中英

java.lang.NoSuchMethodError:com.google.gdata.client.media.MediaService.insert(MediaService.java:318)

DocsService client= new DocsService ("idea");
 client.useSsl ();
  client.setOAuthCredentials (oauthParameters, new OAuthHmacSha1Signer ());
    DocumentListEntry newEntry= new com.google.gdata.data.docs.SpreadsheetEntry ();
        newEntry.setTitle (new PlainTextConstruct ("GIdeaDB"));
        DocumentListEntry insertedEntry= client.insert (new URL (
       "https://docs.google.com/feeds/default/private/full/?xoauth_requestor_id="+                        userEmail), newEntry);

but i got NoSuchMethodException in client.insert (new URL ( "https://docs.google.com/feeds/default/private/full/?xoauth_requestor_id="+ userEmail), newEntry);

what i do please help me....

NoSuchMethodError通常意味着您使用不同版本的库来编译代码而不是用于运行它的代码。

One of the insert methods take three parameters and one takes two. Neither of these methods match what you ate passing in. Which version of the library are you compiling with and which version are you running with? As I said in my comment it is likely to be a version mismatch if it compiles but does not run.

See https://developers.google.com/gdata/javadoc/com/google/gdata/client/docs/DocsService

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