GAE:收到错误“ java.util.concurrent.CancellationException:任务已取消。”在Google存储空间中查询时

时间:2019-05-07 13:06:17

标签: java google-app-engine google-cloud-storage google-apps

在Google Storage实体中查询时,出现以下错误

  

java.util.concurrent.CancellationException:任务已取消。

查询是从UserMappingModel中获取数据。

查询:

  List<UserMappingModel> list = OfyService.ofy().load().type(UserMappingModel.class).filter("userId", userId).list();
            if(list == null || list.size() == 0){
                return null;
            }

在上述查询中运行时出错:

    com.vivoiz.healofy.backend.background.tasks.TaskServlet_CRON doPost: Error in Processing request: (TaskServlet_CRON.java:31)
    java.util.concurrent.CancellationException: Task was cancelled.
        at com.google.common.util.concurrent.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:1355)
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:555)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:436)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:99)
        at com.google.appengine.tools.development.TimedFuture.get(TimedFuture.java:42)
        at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:62)
        at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:93)
        at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:93)
        at com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:69)
        at com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:33)
        at com.google.appengine.api.datastore.BaseQueryResultsSource.getIndexList(BaseQueryResultsSource.java:168)
        at com.google.appengine.api.datastore.BaseQueryResultsSource.loadMoreEntities(BaseQueryResultsSource.java:204)
        at com.google.appengine.api.datastore.BaseQueryResultsSource.loadMoreEntities(BaseQueryResultsSource.java:180)
        at com.google.appengine.api.datastore.QueryResultIteratorImpl.ensureLoaded(QueryResultIteratorImpl.java:173)
        at com.google.appengine.api.datastore.QueryResultIteratorImpl.hasNext(QueryResultIteratorImpl.java:70)
        at com.googlecode.objectify.impl.KeysOnlyIterator.hasNext(KeysOnlyIterator.java:29)
        at com.googlecode.objectify.impl.ChunkIterator.next(ChunkIterator.java:48)
        at com.googlecode.objectify.impl.ChunkIterator.next(ChunkIterator.java:20)
        at com.google.common.collect.Iterators$ConcatenatedIterator.hasNext(Iterators.java:1340)
        at com.google.common.collect.Iterators$PeekingImpl.hasNext(Iterators.java:1133)
        at com.googlecode.objectify.impl.ChunkingIterator.hasNext(ChunkingIterator.java:51)
        at com.google.common.collect.Iterators.addAll(Iterators.java:357)
        at com.google.common.collect.Lists.newArrayList(Lists.java:146)
        at com.googlecode.objectify.util.MakeListResult.translate(MakeListResult.java:22)
        at com.googlecode.objectify.util.MakeListResult.translate(MakeListResult.java:12)
        at com.googlecode.objectify.util.ResultTranslator.nowUncached(ResultTranslator.java:21)
        at com.googlecode.objectify.util.ResultCache.now(ResultCache.java:30)
        at com.googlecode.objectify.util.ResultProxy.invoke(ResultProxy.java:34)
        at com.sun.proxy.$Proxy44.size(Unknown Source)
        at com.vivoiz.healofy.backend.v2.services.UserMappingService.getUserMappingModel(UserMappingService.java:29)
        at com.vivoiz.healofy.backend.v2.managers.MasterUserManager.getMasterUserIdForUserId(MasterUserManager.java:588)
        at com.vivoiz.healofy.backend.background.cron.v2.CronV2Manager.sendQAStatus(CronV2Manager.java:1103)
        at com.vivoiz.healofy.backend.background.cron.CronManager.process(CronManager.java:118)
        at com.vivoiz.healofy.backend.background.tasks.TaskProcessor.processTask(TaskProcessor.java:118)
        at com.vivoiz.healofy.backend.background.tasks.TaskServlet_CRON.doPost(TaskServlet_CRON.java:27)

0 个答案:

没有答案