0
下面的代碼在主從式複製數據存儲區上工作得非常好,現在我們轉移到HRD後發生故障。我看到的唯一的例外就是遷移至HRD後寫入Google數據存儲區的代碼出現故障
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";
}
哦是它..我甚至不記得在哪裏,如果我真的在任何地方添加任何應用程序ID特定的細節。 – Vik