2

I'm trying to get the Java DrEdit example running on GAE exactly as described in the instructions. I've gotten to the point that I can create a new "dredit" document from docs, allow the auth and get to the actual app, but I get this in the GAE logs for every operation that goes back to 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) 

Where I did vary from the instructions, on 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.

I added the libraries under lib/dependencies as well, just adding lib left compile errors.

Community
  • 1
  • 1
Frodo Baggins
  • 8,290
  • 6
  • 45
  • 55

1 Answers1

4

There was a bug in DrEdit Java that made it out to release, essentially skipping a check if a token was missing. The relevant change to fix this bug is here.

I think applying that change will fix the issue for you. I have also updated the guide for this sample.

Vic Fryzel
  • 2,395
  • 16
  • 20
  • Also, thanks for the comment about the build path thing. I've fixed that in the documentation as well. – Vic Fryzel Apr 27 '12 at 21:57
  • Thanks for looking. That gets rid of the 401, but it just fails silently now. I'll dig deeper on my local build, which reminds my of another post I need to make... – Frodo Baggins Apr 28 '12 at 00:50
  • Please do keep posting. FWIW I tested this pretty extensively and am confident that it works, so would love to work out any edge cases that aren't. – Vic Fryzel Apr 28 '12 at 13:22
  • 1
    I got in working in the end, I described the last problem in my answer here - http://stackoverflow.com/a/10370391/226469. Thanks for your support. – Frodo Baggins Apr 29 '12 at 10:52
  • 1
    One other issue, not for you to do anything about, more if anyone else searches for a fix. If your GAE project has Google Cloud SQL enabled then the library for that (google-sql I think) functionality has an identical exception handling method (same package and class name ) that gives complication error for the Java version of DrEdit. My solution was to remove the library :). Thanks again for help, app is deployed and working on chrome store now. – Frodo Baggins May 01 '12 at 15:48