0
我試圖升級我們用於Play的App Engine SDK的版本! web應用程序從1.6.0到1.7.6。未能在升級App Engine Java SDK後打開寫通道
升級之後,我們不再能夠將文件寫入本地開發服務器的blobstore。我們用下面的代碼寫入文件:
Image img = ImagesServiceFactory.makeImage(uploadedData);
FileService fileService = FileServiceFactory.getFileService();
AppEngineFile file = fileService.createNewBlobFile("image/png", "__initial_data/" + vf.getName());
FileWriteChannel writeChannel = fileService.openWriteChannel(file, true);
OutputStream output = Channels.newOutputStream(writeChannel);
到fileService.openWriteChannel
調用失敗,出現以下堆棧跟蹤:
Caused by: java.lang.NullPointerException
at com.google.appengine.tools.development.RequestEndListenerHelper.register(RequestEndListenerHelper.java:39)
at com.google.appengine.api.files.dev.LocalFileService.open(LocalFileService.java:247)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:527)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:481)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:458)
at java.util.concurrent.Executors$PrivilegedCallable$1.run(Executors.java:461)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.concurrent.Executors$PrivilegedCallable.call(Executors.java:458)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
雖然應用程序引擎的SDK是開源的,我無法找到源用於這些特定於開發的類的文件,以查明內部發生了什麼。
有誰知道從1.6.0版本開始,對象寫入blobstore的實現細節是否發生了變化?