Thursday, March 18, 2010

[google-appengine] Re: Image.getHeight throws UnsupportedOperationException when Image instanced from Blobstore

I'll take that as a yes! Bug filed:

http://code.google.com/p/googleappengine/issues/detail?id=2990

Feel free to vote for it. :)

On Mar 16, 1:58 pm, Josh Rehman <j...@joshrehman.com> wrote:
> Do you think I should file a bug?
>
> On Sun, Mar 14, 2010 at 1:24 PM, JavaJosh <javaj...@gmail.com> wrote:
> > Hi there,
>
> > I'm new to Google App Engine, and was wondering what I'm doing wrong.
> > In my application, users upload (potentially large) images into the
> > Blobstore. I also need to create a thumbnail image that is 300px wide
> > (and high enough to maintain aspect ratio). Although
> > ImagesServiceFactory.makeImageFromBlob(blobKey) returns an Image
> > that's not null, when I try to access width and height properties of
> > the returned image I get an UnsupportedOperationException "No image
> > data is available.".
>
> > Here is the simplest code I can think of to reproduce (this is based
> > on blobstore example; to make it work setup that example, then add a
> > web.xml entry for this servlet and then change the "upload" servlet
> > mapping to point to it):
>
> > import java.io.IOException;
> > import java.util.Map;
> > import java.util.logging.Logger;
>
> > import javax.servlet.ServletException;
> > import javax.servlet.http.HttpServlet;
> > import javax.servlet.http.HttpServletRequest;
> > import javax.servlet.http.HttpServletResponse;
>
> > import com.google.appengine.api.blobstore.BlobKey;
> > import com.google.appengine.api.blobstore.BlobstoreService;
> > import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
> > import com.google.appengine.api.images.Image;
> > import com.google.appengine.api.images.ImagesServiceFactory;
>
> > public class ImageBlobBug extends HttpServlet {
> >        private static final long serialVersionUID = 1L;
> >        private BlobstoreService blobstoreService =
> > BlobstoreServiceFactory.getBlobstoreService();
> >        private static final Logger log =
> > Logger.getLogger(ImageBlobBug.class.getName());
>
> >        public void doPost(HttpServletRequest req, HttpServletResponse res)
> > throws ServletException, IOException {
> >                Map<String, BlobKey> blobs =
> > blobstoreService.getUploadedBlobs(req);
> >                BlobKey blobKey = blobs.get("myFile");
> >                Image image =
> > ImagesServiceFactory.makeImageFromBlob(blobKey);
>
> >                res.sendRedirect("#"+ (image == null ? "Image could not be
> > made from
> > blob":"Image successfully retrieved with height: " +
> > image.getHeight()));
> >        }
>
> > }
>
> > Here is the stacktrace:
>
> > java.lang.UnsupportedOperationException: No image data is available.
> >        at
> > com.google.appengine.api.images.ImageImpl.updateDimensions(ImageImpl.java:
> > 130)
> >        at
> > com.google.appengine.api.images.ImageImpl.getHeight(ImageImpl.java:
> > 63)
> >        at ImageBlobBug.doPost(ImageBlobBug.java:27)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> >        at
> > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> > 487)
> >        at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> > 362)
> >        at
> > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> > 216)
> >        at
> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> > 181)
> >        at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> > 712)
> >        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> > 405)
> >        at
>
> > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
> > 70)
> >        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
> >        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
> >        at
>
> > com.google.appengine.api.blobstore.dev.UploadBlobServlet.handleUpload(UploadBlobServlet.java:
> > 368)
> >        at com.google.appengine.api.blobstore.dev.UploadBlobServlet.access
> > $000(UploadBlobServlet.java:72)
> >        at com.google.appengine.api.blobstore.dev.UploadBlobServlet
> > $1.run(UploadBlobServlet.java:100)
> >        at java.security.AccessController.doPrivileged(Native Method)
> >        at
>
> > com.google.appengine.api.blobstore.dev.UploadBlobServlet.doPost(UploadBlobServlet.java:
> > 98)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> >        at
> > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> > 487)
> >        at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1093)
> >        at
>
> > com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
> > 51)
> >        at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1084)
> >        at
>
> > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> > 43)
> >        at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1084)
> >        at
>
> > com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
> > 121)
> >        at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1084)
> >        at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> > 360)
> >        at
> > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> > 216)
> >        at
> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> > 181)
> >        at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> > 712)
> >        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> > 405)
> >        at
>
> > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
> > 70)
> >        at
> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> > 139)
> >        at com.google.appengine.tools.development.JettyContainerService
> > $ApiProxyHandler.handle(JettyContainerService.java:352)
> >        at
> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> > 139)
> >        at org.mortbay.jetty.Server.handle(Server.java:313)
> >        at
> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> > 506)
> >        at org.mortbay.jetty.HttpConnection
> > $RequestHandler.content(HttpConnection.java:844)
> >        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
> >        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
> >        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
> >        at
> > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
> > 396)
> >        at org.mortbay.thread.BoundedThreadPool
> > $PoolThread.run(BoundedThreadPool.java:442)

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

[google-appengine] Re: unable to update my app (authentication issue)

update...

when i add a new developer to the app, i am able to run update on the
app when i authenticate using the new user.

however, the app is functionally broken at the moment because it can't
send email. i've tried setting the "sender" using the owner of the app
as well as the new developer account noted above, but neither of them
work. the mail.send() call will fail with the following...

InvalidSenderError: Unauthorized sender

this is now much worse then simply an update problem. my app is now
broken.

On Mar 18, 9:23 pm, Greg Tracy <g...@gregtracy.com> wrote:
> I'm able to update some of my other apps, but I still can't update the
> 'apodemail' app.
>
> As I look at the list of developers listed in the admin panel for each
> of my apps, there is clearly a disconnect. Some apps have multiple
> entries with the same email address. Some apps have no administrators
> listed. Just developers.
>
> I would appreciate it if someone on the app engine team could look at
> this. I believe something got disconnected when the email address for
> the google account was changed.
>
> Thanks.
>
> On Mar 18, 1:59 pm, Greg Tracy <g...@gregtracy.com> wrote:
>
> > Since changing the email address on my Google account, I have not been
> > able to update my application. Command line and SDK updates fail with
> > the following...
>
> > Password for greg@<hidden>.com: Invalid username or password.
> > Error 401: --- begin server output ---
> > Must authenticate first.
> > --- end server output ---
> > 2010-03-18 13:57:32 (Process exited with code 1)
>
> > Is this a caching issue in app engine? The email was changed yesterday
> > afternoon...
>
> > This is happening for the app, apodemail.appspot.com
>
> > Thanks.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

[google-appengine] I've never seen anything like this before

If you can't see this email, please click here.

Simon
Simon wants you to become a Zorpian
Hi ,
These are some of the nice people I met that have brightened up my life, try it! The link below will add you to my friends list.
Join now for free!
Simon's Friends:
This message was delivered with the simon initiation.
If you wish to discontinue receiving invitations from us, please click here: Block future invitations
Copyright © 2003-2010 Zorpia.com All rights reserved.

Re: [google-appengine] Session Data must be in DataStore?

For whatever its' worth, I have HTTP Basic auth implemented in my web service and it fetches the user's account details from the datastore each time a request is made and it doesn't seem to be a huge problem.

On Wed, Mar 17, 2010 at 4:41 PM, Guy Smith <guy@multiniche.org> wrote:
"If a web application wants to store session data, then it must be
stored in the DataStore rather than static variables or MemCache."  -
is that correct?

I understand the reasoning behind it – that separate requests in a
session may go to different servers, which will not have the same
values in static variables or MemCache, only the DataStore is shared
between servers. But it is expensive (in developer time and DataStore
writes), so I'd just like to double check.

NB: I have a fair bit of session data – encoding it in the cookie is
not feasible.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.




--
Patrick H. Twohig.

Namazu Studios
P.O. Box 34161
San Diego, CA 92163-4161

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Re: [google-appengine] Re: How can I efficiently retrieve entities for a list of keys? (Java)

Thanks! Knew it had to be in there somewhere. :)

http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreService.html#get(java.lang.Iterable)


On Thu, Mar 18, 2010 at 5:39 PM, Tristan <tristan.slominski@gmail.com> wrote:
look in DatastoreService get()

On Mar 18, 7:33 pm, JavaJosh <javaj...@gmail.com> wrote:
> BTW in python this would be db.get(keys). :)
>
> On Mar 18, 5:32 pm, JavaJosh <javaj...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > I'd like to use the low-level datastore API (Java) to deference a
> > (potentially long) list of keys into their respective Entities. I've
> > scoured the API and searched messages in this group, and don't see any
> > answers.
>
> > I primarily looked for a method on Query that takes a Collection or
> > Array of Keys. Didn't find it.
>
> > For now I can get by with a for loop. Ghetto but it works. I'd like to
> > do better.
>
> > Thanks.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

[google-appengine] Re: unable to update my app (authentication issue)

I'm able to update some of my other apps, but I still can't update the
'apodemail' app.

As I look at the list of developers listed in the admin panel for each
of my apps, there is clearly a disconnect. Some apps have multiple
entries with the same email address. Some apps have no administrators
listed. Just developers.

I would appreciate it if someone on the app engine team could look at
this. I believe something got disconnected when the email address for
the google account was changed.

Thanks.

On Mar 18, 1:59 pm, Greg Tracy <g...@gregtracy.com> wrote:
> Since changing the email address on my Google account, I have not been
> able to update my application. Command line and SDK updates fail with
> the following...
>
> Password for greg@<hidden>.com: Invalid username or password.
> Error 401: --- begin server output ---
> Must authenticate first.
> --- end server output ---
> 2010-03-18 13:57:32 (Process exited with code 1)
>
> Is this a caching issue in app engine? The email was changed yesterday
> afternoon...
>
> This is happening for the app, apodemail.appspot.com
>
> Thanks.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

[google-appengine] Re: how to clean appengine datastore in eclipse plugin ?

go to war/WEB-INF/appengine-generated and delete file called
local_db.bin

On Mar 17, 4:02 am, "V.Chalmel" <vchal...@gmail.com> wrote:
> Hi !
>
> I'm currently working on an initialization script for my application,
> and I need my training datastore, in appengine eclipse plugin, to be
> totally empty, how to easily clean it ? I didn't found in eclipse menu
> anything concerning the appengine plugin datastore.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.