Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine java.security.AccessControlException:拒绝访问_Google App Engine_Gwt_Prediction_Google Prediction - Fatal编程技术网

Google app engine java.security.AccessControlException:拒绝访问

Google app engine java.security.AccessControlException:拒绝访问,google-app-engine,gwt,prediction,google-prediction,Google App Engine,Gwt,Prediction,Google Prediction,我已经创建了使用预测Api 1.5v的Google应用程序引擎项目。当我在本地主机上运行它时,它工作得很好。使用带有客户端id和客户端机密的Google o2Auth身份验证:8888。但是,当我运行它时,它将给出一个错误,如下所示: java.security.AccessControlException:拒绝访问(“java.io.FilePermission”“/base/data/home/apps/s~charn project/1.369216781240579013/.creden

我已经创建了使用预测Api 1.5v的Google应用程序引擎项目。当我在本地主机上运行它时,它工作得很好。使用带有客户端id和客户端机密的Google o2Auth身份验证:8888。但是,当我运行它时,它将给出一个错误,如下所示:

java.security.AccessControlException:拒绝访问(“java.io.FilePermission”“/base/data/home/apps/s~charn project/1.369216781240579013/.credentials”“write”)

我的o2auth代码如下

GoogleClientSecrets clientSecrets=GoogleClientSecrets.load(JSON_工厂, 新的InputStreamReader(Database.class.getResourceAsStream(“/client\u secrets.json”); System.out.println(“cl”+clientSecrets.getDetails().getClientSecret())

可能是这方面的问题

FileCredentialStore credentialStore=新的FileCredentialStore(
新文件(System.getProperty(“user.home”)、“.credentials/prediction.json”)、json_工厂)

应用程序引擎当前不支持写入文件

资料来源:

high replication data store(HRD)非常易于使用,对于Objectify()这样的项目更容易使用。我建议你去看看

    if (clientSecrets.getDetails().getClientId().startsWith("Enter")
            || clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {

        System.out.println(
              "Enter Client ID and Secret from https://code.google.com/apis/console/?api=prediction "
              + "into prediction-cmdline-sample/src/main/resources/client_secrets.json");
          System.exit(1);
        }
        // set up file credential store
       FileCredentialStore credentialStore = new FileCredentialStore(
            new File(System.getProperty("user.home"), ".credentials/prediction.json"), JSON_FACTORY);
        // set up authorization code flow
       System.out.println("cre"+credentialStore);
       GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
            httpTransport, JSON_FACTORY, clientSecrets,
            Collections.singleton(PredictionScopes.PREDICTION)).setCredentialStore(credentialStore)
            .build();

        // authorize
        return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");