Hi Basia,
The setUserCredentials method throws an AuthenticationException if the
CalendarService is not able to validate the user's credentials. There
are several subclasses of AuthenticationException that may be thrown,
depending on what went wrong.
You may want to print out the cause of the exception using the
printStackTrace method:
catch(Exception e){
System.out.println("Cannot set Credentials in update Event
of GoogleWeb");
e.printStackTrace();
return false;
}
Once you have the error message you can find more information about
the ClientLogin errors here:
http://code.google.com/apis/accounts/AuthForInstalledApps.html#Errors
Hope that helps,
Lane
On Apr 23, 1:21 pm, Basia <[EMAIL PROTECTED]> wrote:
> I have a java application that queries events from
> googlecalendar....in addition i have created a jsp page that queries
> events from googlecalendar. Since yesterday the jsp page is not
> working. It goes to the exception "Cannot set Credentials in update
> Event of GoogleWeb"....did something change on the Google Calendar API
> side?
>
> code is below:
>
> String CALENDAR_FEEDS_URL = "http://www.google.com/calendar/
> feeds";
> CalendarService calendarService;
> try{
> URL privateFeedUrl = new URL(CALENDAR_FEEDS_URL + "/
> default/private/full");
> }
> catch(Exception e){
> System.out.println("Cannot set private feed url in update
> Event of GoogleWeb");
> return false;
> }
> calendarService = new CalendarService("stonybrook-
> RavenCalendar-1");
> try{
>
> calendarService.setUserCredentials("[EMAIL PROTECTED]",
> "XXXXXXXXXX");
> }
> catch(Exception e){
> System.out.println("Cannot set Credentials in update Event
> of GoogleWeb");
> return false;
> }
>
> CalendarQuery myQuery = new CalendarQuery(privateFeedUrl);
> myQuery.setMinimumStartTime(info.getStartDate());
> myQuery.setMaximumStartTime(info.getEndDate());
>
> CalendarEventFeed resultFeed;
> try{
> resultFeed = calendarService.query(myQuery,
> CalendarEventFeed.class);
> }
> catch(Exception e){
> System.out.println("Cannot query in update Event of
> GoogleWeb");
> return false;
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---