brtrbr / google-drive-sdk-samples

Automatically exported from code.google.com/p/google-drive-sdk-samples
0 stars 0 forks source link

DrEdit Java not working #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Done Everything as stated in the Setting Up Instructions page
2. I have every latest SDK installed

After uploading and running the example on appspot, I am asked to allow access 
to the App.
After I accept it, I am redirected to this URL 
https://driveexample.appspot.com/oauth2callback?code=4/p_Spcvd4ulncp2NMuOmfOo7Sw
rZ5.Uild629A4i0agrKXntQAax0-ZdhfeQI

and the page displays 
"Error: Server Error

The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error 
message and the query that caused it."

I have tried mapping the /oauth2call to every servlet in the project, but for 
no success.
Checked the logs. It shows Error for /oauth2callback
java.lang.NoSuchMethodError: 
com.google.api.services.oauth2.Oauth2$Userinfo$Get.execute()Ljava/lang/Object;
    at com.google.drive.samples.dredit.CredentialMediator.getUserInfo(CredentialMediator.java:204)
    at com.google.drive.samples.dredit.CredentialMediator.getActiveCredential(CredentialMediator.java:288)
    at com.google.drive.samples.dredit.DrEditServlet.getCredentialMediator(DrEditServlet.java:92)
    at com.google.drive.samples.dredit.DrEditServlet.getClientId(DrEditServlet.java:137)
    at com.google.drive.samples.dredit.StartPageServlet.doGet(StartPageServlet.java:43)

More details in image

Original issue reported on code.google.com by meetma...@gmail.com on 6 Feb 2013 at 2:54

Attachments:

GoogleCodeExporter commented 9 years ago
Is there any problem in this function in CredentialMediator??

private Userinfo getUserInfo(Credential credential)
      throws NoUserIdException {
    Userinfo userInfo = null;

    // Create a user info service, and make a request to get the user's info.
    Oauth2 userInfoService =
        new Oauth2.Builder(TRANSPORT, JSON_FACTORY, credential).build();
    try {
        userInfo = userInfoService.userinfo().get().execute();
      if (userInfo == null) {
        throw new NoUserIdException();
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
    return userInfo;
  }

Original comment by meetma...@gmail.com on 7 Feb 2013 at 8:28

GoogleCodeExporter commented 9 years ago
Hello, I have the same problem. Have you find the solution? 

Original comment by ale...@gmail.com on 1 Mar 2013 at 2:19

GoogleCodeExporter commented 9 years ago
1. Add Google API (Drive API, Google OAuth2 API) from "Google Plugin for 
Eclipse" menu.
   ref. screenshot1.png

2. Project => properties => Java Build Path => Order and Export
   Check "Drive API" and "Google OAuth2 API"
   ref. screenshot2.png

3. Check the folder "WEB-INF/lib"
   ref. screenshot3.png

and I solved this problem.

Original comment by sunnysid...@gmail.com on 2 Mar 2013 at 1:42

Attachments:

GoogleCodeExporter commented 9 years ago
i am following above flow but i am not getting any out put.

Original comment by sandya....@gmail.com on 11 Jun 2013 at 9:48

GoogleCodeExporter commented 9 years ago
i am following above flow but i am not getting any out put.if u now how to 
slove these problm plz give suggestions

http://delhiadbox.appspot.com/?code=4/XZDVdDJ9v7SziXAKs0qDcDqVBly4.0kBFKvnEv2sbg
rKXntQAax06GCBlfgI

Error: Server Error

The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error 
message and the query that caused it.

Original comment by sandya....@gmail.com on 11 Jun 2013 at 9:52