Google cloud storage 如何使用java将文件和图像放入google cloudstorage

Google cloud storage 如何使用java将文件和图像放入google cloudstorage,google-cloud-storage,Google Cloud Storage,我第一次尝试使用谷歌云存储 我只是遵循文章中给出的步骤 我已按照以下步骤操作 我在xyz.com域中创建了一个应用程序,我的应用程序的服务帐户名为“myapp@appspot.gserviceaccount.com“ 然后,我转到GoogleAPI控制台上的“团队”选项卡,并尝试将我的应用程序的服务帐户名称添加到激活GoogleCloud Storage的项目中 它已成功添加,但状态待定。我如何将状态更改为活动状态。当我运行我的项目时,我得到 Uncaught exception from se

我第一次尝试使用谷歌云存储

我只是遵循文章中给出的步骤

我已按照以下步骤操作

  • 我在xyz.com域中创建了一个应用程序,我的应用程序的服务帐户名为“myapp@appspot.gserviceaccount.com“

  • 然后,我转到GoogleAPI控制台上的“团队”选项卡,并尝试将我的应用程序的服务帐户名称添加到激活GoogleCloud Storage的项目中

  • 它已成功添加,但状态待定。我如何将状态更改为活动状态。当我运行我的项目时,我得到

    Uncaught exception from servlet
    java.io.IOException
    at com.google.appengine.api.files.FileServiceImpl.translateException(FileServiceImpl.java:620)
    at com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServiceImpl.java:593)
    at com.google.appengine.api.files.FileServiceImpl.create(FileServiceImpl.java:511)
    at com.google.appengine.api.files.FileServiceImpl.createNewGSFile(FileServiceImpl.java:155)
    at com.cloudcodes.com.TestBucket.doGet(TestBucket.java:34)
    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 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:266)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:439)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:446)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:740)
    at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:717)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:722)
    
    Caused by: com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 8: 
    at java.lang.Thread.getStackTrace(Thread.java:1567)
    at com.google.apphosting.runtime.ApiProxyImpl.doSyncCall(ApiProxyImpl.java:259)
    at com.google.apphosting.runtime.ApiProxyImpl.access$000(ApiProxyImpl.java:68)
    at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:202)
    at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:199)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:199)
    at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:68)
    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:589)
    

    有人能帮我吗?

    你能发布你的代码吗?你启用了计费吗?在我的项目中,我启用了cloudsql计费,但我没有启用cloudstorage计费,因为我找不到任何启用cloudstorage计费的选项。如何启用cloudstorage计费也请告诉我