问题
I'm using appengine-gcs-client-0.5 and seeing InvocationTargetExceptions in my dev_appserver when calling GcsService.createOrReplace and GcsOutputChannel.close.
It seems like the call to storeBlob does not have the appropriate permission, as the appserver gets an AccessControlException in com.google.appengine.api.blobstore.dev.FileBlobStorage.storeBlob:
java.security.AccessControlException: access denied ("java.io.FilePermission" "/tmp/1440435923000-0/encoded_gs_key:<some key>" "write")
What do I need to do to get this working?
回答1:
appengine-gcs-client-0.5 removed a dependency on the deprecated Files API, but the SDK does not yet acquire the necessary permissions to store files the BlobStorage service. As a workaround until the next SDK version is released, you can pass a flag to configure a memory-backed store for the Blobstore service like so:
dev_appserver.sh --jvm_flag=-Dblobstore.no_storage=true
This is only necessary for the dev_appserver - production applications will not have this problem.
回答2:
Starting with AE 1.9.27 (which is now available) there is no longer a need for the jvm_flag (it should just work).
来源:https://stackoverflow.com/questions/32236614/invocationtargetexception-storing-files-with-appengine-gcs-client-0-5-dev-appser