为什么 createDataStore() 会抛出 com.google.appengine.api.datastore.EntityNotFoundException?

问题描述

当我尝试将 DataStoreFactory 设置为 GoogleAuthorizationCodeFlow 时抛出 EntityNotFoundException。 我的代码

@Bean
    public GoogleAuthorizationCodeFlow googleAuthorizationCodeFlow() throws GeneralSecurityException,IOException {
        InputStream in = GoogleService.class.getResourceAsStream(CREDENTIALS_FILE_PATH);
        GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,new InputStreamReader(in));
        AppEngineDataStoreFactory factory = AppEngineDataStoreFactory.getDefaultInstance();
        return new GoogleAuthorizationCodeFlow.Builder(
                netHttpTransport(),JSON_FACTORY,clientSecrets,SCOPES)
                .setDataStoreFactory(factory)
                .setApprovalPrompt("force")
                .setAccessType("offline")
                .build();
    }

.setDataStoreFactory(factory) 抛出这个异常。

protected <V extends Serializable> DataStore<V> createDataStore(String id) throws IOException {
        return new AppEngineDataStoreFactory.AppEngineDataStore(this,id);
    }

此方法后 debbug 停止工作。 我不明白为什么会这样。

有人可以帮我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)