Hi Buminda. Is your code similar to CHEN's above? It looks like he's trying
to use the Blobstore service in the context of a framework -- are you doing
something similar? If so, can you please provide your servlet/controller
source and mappings? Also, what is the URL in your address bar when you see
this exception? Does it look similar to http://<APPID>.
appspot.com/_ah/upload/<KEY> or is it redirecting successfully to your
handler (/story_add.do in CHEN's example)? Finally, can you confirm whether
you see the new blob in the Admin Console's Blob Viewer?

- Jason

On Tue, Jan 12, 2010 at 4:10 AM, GMap <bumi...@gmail.com> wrote:

> Hello ,
>      I'm having the same problem , any solution ?
> Thanks
> Regards
> Buminda
>
>
> On Dec 20 2009, 5:21 pm, CHEN <ncow...@gmail.com> wrote:
> > i am using appengine-java-sdk-1.3.0 with eclipse now.
> >
> > in my page,when i click the SUBMIT button,it shows this message:
> > =======================================
> > HTTP ERROR: 500
> >
> > Must call one of set*BlobStorage() first.
> > RequestURI=/_ah/upload/
> > agtzaG9ydC1zdG9yeXIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGCsM
> >
> > Caused by:
> >
> > java.lang.IllegalStateException: Must call one of set*BlobStorage()
> > first.
> >         at
> > com.google.appengine.api.blobstore.dev.BlobStorageFactory.getBlobStorage
> > (BlobStorageFactory.java:24)
> >         at com.google.appengine.api.blobstore.dev.UploadBlobServlet.init
> > (UploadBlobServlet.java:88)
> >         at javax.servlet.GenericServlet.init(GenericServlet.java:215)
> >         at org.mortbay.jetty.servlet.ServletHolder.initServlet
> > (ServletHolder.java:433)
> >         at org.mortbay.jetty.servlet.ServletHolder.getServlet
> > (ServletHolder.java:342)
> >         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> > 463)
> > =======================================
> >
> > Form:
> > =======================================
> > ....
> > <%@ page
> >
> import="com.google.appengine.api.blobstore.BlobstoreServiceFactory"%>
> > <%@ page
> > import="com.google.appengine.api.blobstore.BlobstoreService"%>
> > <%
> >         BlobstoreService blobstoreService = BlobstoreServiceFactory
> >                         .getBlobstoreService();
> > %>
> > <form:form
> >         action="<%= blobstoreService.createUploadUrl("/story_add.do") %>"
> >         method="post" enctype="multipart/form-data"
> commandName="theStory">
> > ....
> > =======================================
> >
> > Receiver:
> > =======================================
> >         @RequestMapping(value = "/story_add.do", method =
> RequestMethod.POST)
> >         @ModelAttribute("theStory")
> >         private ShortStory add(ShortStory shortStory, Model model,
> > HttpServletRequest request) {
> >                 Map<String, BlobKey> blobs =
> blobstoreService.getUploadedBlobs
> > (request);
> >                 BlobKey blobKey = blobs.get("file");
> >                 if (blobKey != null) {
> >                         shortStory.setFile(blobKey);
> >                 }
> > .....
> > =======================================
> >
> > what's the wrong?thank you very much.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to