Google Calendar API:com.google.api.client.googleapis.json.GoogleJsonResponseException:404未找到

问题描述 投票:1回答:1

我正在使用Rabbitmq和Calendar API将事件推送到日历,在创建新事件推送到日历时遇到以下错误。日志如下:

18:22:10.210 [pool-1-thread-3] INFO  c.q.c.rabbitmq.RabbitMQEventConsumer - Received message of type class com.qpercom.model.CreateOrUpdateEventMessage on event (185, omis19demo)
18:22:10.718 [pool-1-thread-3] INFO  com.zaxxer.hikari.HikariDataSource - googleApiDb - Starting...
18:22:10.956 [pool-1-thread-3] INFO  com.zaxxer.hikari.HikariDataSource - googleApiDb - Start completed.
18:22:12.293 [pool-1-thread-3] INFO  c.q.c.google.GoogleCalendarPusher - Creating event in Google Calendar
18:22:12.389 [pool-1-thread-3] INFO  c.q.c.google.GoogleCalendarPusher - Instantiating Google Calendar Service...
18:22:13.628 [pool-1-thread-3] ERROR c.q.c.rabbitmq.RabbitMQEventConsumer - Failed pushing event. The message has been re-queued. Trace of exception: com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}
18:22:13.630 [pool-1-thread-3] ERROR c.r.c.impl.ForgivingExceptionHandler - Consumer com.qpercom.consumer.rabbitmq.RabbitMQEventConsumer$$anon$1@2c239f25 (amq.ctag-DEd0iKxMhKd8bqZ9tvET7w) method handleDelivery for channel AMQChannel(amqp://[email protected]:5672/,1) threw an exception for channel AMQChannel(amqp://[email protected]:5672/,1)
com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:444)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1108)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:542)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:475)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:592)
    at com.qpercom.calendar.google.GoogleCalendarPusher.doCreate(GoogleCalendarPusher.scala:61)
    at com.qpercom.calendar.google.GoogleCalendarPusher.doCreate(GoogleCalendarPusher.scala:25)
    at com.qpercom.calendar.AbstractAPICalendarPusher.pushCreateOrUpdate(AbstractAPICalendarPusher.scala:74)
    at com.qpercom.App$$anonfun$main$1.apply(App.scala:26)
    at com.qpercom.App$$anonfun$main$1.apply(App.scala:22)
    at com.qpercom.consumer.rabbitmq.RabbitMQEventConsumer$$anon$1.handleDelivery(RabbitMQEventConsumer.scala:49)
    at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
    at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

任何解决方案将不胜感激。在此先感谢

rabbitmq google-calendar-api google-api-js-client google-json-api
1个回答
0
投票

将.createDelegated(String User)添加到ServiceaccountCredentials对象。

© www.soinside.com 2019 - 2024. All rights reserved.