GAE Must call one of set*BlobStorage() first
Asked Answered
H

1

15

I have searched through google, stackoverflow, and other sources too. But no luck so far.

I am developing an application for GAE with Java at backend and android at other end. Now server is setup on local machine, and it is being accessed by android via wifi using ip address.

when trying to upload the image, i first requested for uploadUrl which i am getting successfully. only issue i see there is that instead of pc ip address it is having the pc name. So for now i am replacing pc name to be ip address.

After when I actually try to post multipart image file, it is throwing exception java.lang.IllegalStateException: Must call one of set*BlobStorage() first

Now I am not able pass this obstacle. I have seen probable reasons for this

  1. I am changing pc name to ip address - making link invalid altogather
  2. as read somewhere this url's can be hit only once, but i am hitting it only once.
  3. Dev environment is the problem, means only solution left is to deploy it?

Please help me out. Stuck badly with this. Thanks a lot in advance

UPDATE - 04/12/2015

SEVERE: javax.servlet.ServletContext log: unavailable
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:102)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
    at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
    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 com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
    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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:491)
    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.content(HttpConnection.java:938)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Headrace answered 1/10, 2015 at 19:57 Comment(0)
D
5

I believe you're working with Eclipse.

If you are not using Maven, make sure the App Engine testing and stub jars are not in your war/WEB-INF/lib directory when running the GAE Development Server.

The gwt-maven-plugin is copying this libraries into your classpath. When the mentioned jar files are removed, everything should work as expected.

Additionally, you can later remove the Eclipse run configuration and restart, just to make sure it's all "clean".

UPDATE:

Similar cases:

Dade answered 8/10, 2015 at 8:55 Comment(2)
Hi, thanks for response, I am using android studio latest version. I also gone through the links you provided, before posting this question, but no luck.Headrace
Is there anything else which could lead to this issue?Headrace

© 2022 - 2024 — McMap. All rights reserved.