0

以下のコードは、マスター/スレーブ レプリケーション データストアでは問題なく動作していましたが、今日 HRD に移行した後に機能しなくなりました。私が見る例外はただ

E 2012-09-19 21:59:13.603
vik.sakshum.sakshumweb.server.common.CommonServiceCode writeToGoogleStore: Exception in finally of execute of writeToGoogleStore
E 2012-09-19 21:59:13.603
vik.sakshum.sakshumweb.server.common.CommonServiceCode writeToGoogleStore: Exception class is :java.io.IOException
E 2012-09-19 21:59:13.603
vik.sakshum.sakshumweb.server.common.CommonServiceCode writeToGoogleStore: Exception is :null

コード

try {

        log.info("Starting google storage");
        // Get the file service
        FileService fileService = FileServiceFactory.getFileService();
        GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()
                .setBucket(bucketName).setKey(key).setAcl("public-read")
                .setMimeType("text/html");

        // Create your object
        AppEngineFile writableFile = fileService
                .createNewGSFile(optionsBuilder.build());

        // Open a channel for writing
        boolean lockForWrite = true;
        FileWriteChannel writeChannel = fileService.openWriteChannel(
                writableFile, lockForWrite);
        PrintWriter out = new PrintWriter(Channels.newWriter(writeChannel,
                "UTF8"));
        out.println(emailMsgTxt);
        out.close();
        writeChannel.closeFinally();
    } catch (Exception e) {
        e.printStackTrace();
        log.severe("Exception in finally of execute of writeToGoogleStore");
        log.severe("Exception class is :" + e.getClass().getName());
        log.severe("Exception is :" + e.getMessage());
        return "failed";
    }
4

1 に答える 1

1

HRに移行するということは、新しいアプリ名とサービスアカウント名を取得することも意味します。おそらく、そのストレージバケットのACLに新しいアカウントを追加する必要があります。

于 2012-09-20T10:28:53.663 に答える