2011-11-13 11 views
1

私は実験Writing Files to Blobstoreを使用しようとしましたが、デモコードを使用しても、ファイルを読み取ろうとするとFinalizationExceptionが発生します。FinalizationException - AppEngine Java Blobstore API

I、使用コードは、以下である:

FileService fileService = FileServiceFactory.getFileService(); 

AppEngineFile file = null; 
file = fileService.createNewBlobFile("text/plain"); 

FileWriteChannel writeChannel = fileService.openWriteChannel(file, true); 

PrintWriter out = new PrintWriter(Channels.newWriter(writeChannel, "UTF8")); 
out.println("The woods are lovely dark and deep."); 
out.println("But I have promises to keep."); 

out.close(); 
String path = file.getFullPath(); 

file = new AppEngineFile(path); 

writeChannel = fileService.openWriteChannel(file, true); 

writeChannel.write(ByteBuffer.wrap("And miles to go before I sleep.".getBytes())); 

writeChannel.closeFinally(); 

私は別の要求内FinalizationExceptionを取得読み出しコードは以下の通りである:

FileService fileService = FileServiceFactory.getFileService(); 

    String path = //get the path code  
    AppEngineFile file = new AppEngineFile(path); 

    FileReadChannel readChannel; 
    try { 
     readChannel = fileService.openReadChannel(file, false); 
    } catch (FileNotFoundException e) { } 

IはopenReadChannelラインで確定例外を取得

ご協力いただければ幸いです。

+0

解決しましたか?私は同様の問題に立ち往生しています –

+0

Seconded、あなたはこの問題を解決しましたか? –

答えて

0

この例は、開発サーバーで正常に動作します。

関連する問題