InvocationTargetException storing files with appengine-gcs-client-0.5 dev_appserver

為{幸葍}努か 提交于 2020-01-13 19:16:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!