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的实现细节是否发生了变化?