Mehdisouid / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Getting a lot of 404's #688

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Since last week friday I noticed a lot of 4O4 not found error's.

When I try to do a getCalendar or insertEvent I get the following message in an 
IOException:

ex = (com.google.api.client.googleapis.json.GoogleJsonResponseException) 
com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}

Original issue reported on code.google.com by stephan....@gmail.com on 17 Dec 2012 at 1:23

GoogleCodeExporter commented 9 years ago
Also from the API console:
 Requests % Requests Methods Error codes

416     63.32%  calendar.calendars.get  400     
241     36.68%  calendar.events.insert  400 

Original comment by stephan....@gmail.com on 17 Dec 2012 at 1:23

GoogleCodeExporter commented 9 years ago
More information:

 <dependencies>
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-calendar</artifactId>
      <version>v3-rev19-1.12.0-beta</version>
    </dependency>
    <dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client-jackson2</artifactId>
      <version>${project.http.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.oauth-client</groupId>
      <artifactId>google-oauth-client-jetty</artifactId>
      <version>${project.oauth.version}</version>
    </dependency>
  </dependencies>

___

I use JDK 1.7

___

Situation
Trying to connect to the calendars of a Google Domain using a Service Account:

GoogleCredential credential = new GoogleCredential.Builder()
                        .setTransport(HTTP_TRANSPORT)
                        .setJsonFactory(JSON_FACTORY)
                        .setServiceAccountId(<...@developer.gserviceaccount.com>)
                        .setServiceAccountScopes(CalendarScopes.CALENDAR, CalendarScopes.CALENDAR_READONLY)
                        .setServiceAccountPrivateKeyFromP12File(<my key.p12 file>)
                        .build();

client = new com.google.api.services.calendar.Calendar.Builder(
                            HTTP_TRANSPORT, JSON_FACTORY, credential)
                            .setApplicationName("HolidaySyncs").build();

 Event result = client.events().insert(holiday.getCalendarId(), event).execute();

Original comment by stephan....@gmail.com on 17 Dec 2012 at 1:48

GoogleCodeExporter commented 9 years ago
please higher the priority. My application get's these error 95% of the times 
and it is really annoying because my project is close to release to our client.

Original comment by stephan....@gmail.com on 17 Dec 2012 at 2:39

GoogleCodeExporter commented 9 years ago
Sorry to hear about this problem you are encountering.

I recommend that you ask this question on either StackOverflow:
http://code.google.com/p/google-api-java-client/wiki/Support#Ask_Questions

Or on the Calendar API forum:
https://groups.google.com/forum/?fromgroups#!forum/google-calendar-api

Original comment by yan...@google.com on 17 Dec 2012 at 3:05

GoogleCodeExporter commented 9 years ago
This often happens when the user is a google user but he isn't connecte to 
google plus. 

It should also explode in this call: service.people().get("me").execute();

Original comment by mufumb...@gmail.com on 22 Aug 2013 at 10:03