ここで奇妙なことが起こっています。以下を呼び出す単体テストを実行する場合:
FileService fileService = FileServiceFactory.getFileService();
writeChannel = fileService.openWriteChannel(file, lock);
writeChannel.closeFinally();
次の例外が発生します-コードは単体テストの外部および他のワークステーションで正常に実行されるため、使用を余儀なくされているWindows XPラップトップの環境の問題です. 私の他のPCとラップトップ(ubuntuを実行)でテストが正常に実行されます
java.lang.RuntimeException: illegal blobKey: pIONuF92LGIK8TV41YSSdQ
at com.google.appengine.api.blobstore.dev.FileBlobStorage.getFileForBlob(FileBlobStorage.java:95)
at com.google.appengine.api.blobstore.dev.FileBlobStorage.storeBlob(FileBlobStorage.java:45)
at com.google.appengine.api.files.dev.BlobstoreFile.getOutputStream(BlobstoreFile.java:225)
at com.google.appengine.api.files.dev.FileMetadata.setFinalized(FileMetadata.java:97)
at com.google.appengine.api.files.dev.BlobstoreFile.setFinalized(BlobstoreFile.java:212)
at com.google.appengine.api.files.dev.LocalFileService.close(LocalFileService.java:334)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:498)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:452)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:430)
at java.util.concurrent.Executors$PrivilegedCallable$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.concurrent.Executors$PrivilegedCallable.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)