我创建了一个服务帐户名称,可以“编辑”以访问Google云端存储。我使用了Complete sample Application中为java提供的示例应用程序并部署在app引擎中。在浏览器中调用servlet时会出现这样的错误,
Uncaught exception from servlet
java.io.IOException
at com.google.appengine.api.files.FileServiceImpl.translateException(FileServiceImpl.java:615)
at com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServiceImpl.java:588)
at com.google.appengine.api.files.FileServiceImpl.create(FileServiceImpl.java:506)
at com.google.appengine.api.files.FileServiceImpl.createNewGSFile(FileServiceImpl.java:153)
at com.audioapp.ListpeopleServlet.doGet(ListpeopleServlet.java:36)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:679)
Caused by: com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 8:
at java.lang.Thread.getStackTrace(Thread.java:1495)
at com.google.apphosting.runtime.ApiProxyImpl.doSyncCall(ApiProxyImpl.java:240)
at com.google.apphosting.runtime.ApiProxyImpl.access$000(ApiProxyImpl.java:66)
at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:183)
at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:180)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:180)
at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:66)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:107)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:56)
at com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServiceImpl.java:584)
任何人都可以建议我解决这个问题。
提前致谢!
答案 0 :(得分:1)
您是否按照文档[1] - >中的说明授予访问权限?在 5下。授予您的存储桶或对象的权限。)?
您使用的是哪个SDK版本?也许这是一个旧的SDK版本导致了这个异常。
[1] https://developers.google.com/appengine/docs/java/googlestorage/overview