2

我通读了这个链接,对如何在我的项目中集成blobstore api有点困惑。

我在 WEB-INF 文件夹下添加了 appengine 库,并从上面发布的链接中复制了上传和服务的代码示例。我添加了 tomcat 服务器并测试了示例 servlet 程序,它工作正常。

但是当我测试代码时它会抛出我

HTTP Status 500 - Must be called from a blob upload callback request.

type 
    Exception 

report
    message must be called from a blob upload callback request.

description 
    The server encountered an internal error that prevented it from fulfilling this request.

exception 
    java.lang.IllegalStateException: Must be called from a blob upload callback request.
com.google.appengine.api.blobstore.BlobstoreServiceImpl.getUploads(BlobstoreServiceImpl.java:169)
com.google.appengine.api.blobstore.BlobstoreServiceImpl.getUploadedBlobs(BlobstoreServiceImpl.java:152)
my.Upload.doPost(Upload.java:34)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

我不知道如何添加 blobstore 服务。我想要得到的只是能够上传图像并取回我将转换为位图并放在 imageview 上的 blob 类型。这里出了什么问题,我该如何解决?

4

0 回答 0