Anyone ever have this happen? It's the opposite of working in dev and failing in deployed.
My web app successfully uses ImagesServiceImpl.getServingUrl() on Deployment but not in dev server.
I looked here to see if there was something missing in my dev environment configuration that the deployed environment has: https://developers.google.com/appengine/docs/java/config/appconfig#About_appengine_web_xml
Also looked here: https://developers.google.com/appengine/docs/java/images/overview#Development_Server.
Here's what happens in my console when I run the code giving me trouble:
Oct 13, 2012 8:40:33 AM com.google.appengine.api.images.dev.LocalImagesService init
WARNING: No image reader found for format "ico". An ImageIO plugin must be installed to use this format with the DevAppServer.
Oct 13, 2012 8:40:33 AM com.google.appengine.api.images.dev.LocalImagesService init
WARNING: No image reader found for format "tif". An ImageIO plugin must be installed to use this format with the DevAppServer.
Oct 13, 2012 8:40:33 AM com.google.appengine.api.images.dev.LocalImagesService init
WARNING: No image reader found for format "webp". An ImageIO plugin must be installed to use this format with the DevAppServer.
Oct 13, 2012 8:40:33 AM com.google.appengine.api.images.dev.LocalImagesService init
WARNING: No image writer found for format "webp". An ImageIO plugin must be installed to use this format with the DevAppServer.
Oct 13, 2012 8:40:34 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: /upload
java.lang.IllegalArgumentException: Failed to read image
at com.google.appengine.api.images.ImagesServiceImpl.getServingUrl(ImagesServiceImpl.java:282)
Although I don't have a webp, ico, and tif decoder plugin, that shouldn't be a problem since I'm ONLY dealing with jpeg images.
Here's a portion of the code:
FileService fileService = FileServiceFactory.getFileService();
AppEngineFile newBlob = fileService.createNewBlobFile("image/jpeg");
// Create a new Blob file with mime-type "image/jpeg"
byte[] buffer = new byte[4096]; // 4MB
boolean lock = true;
FileWriteChannel writeChannel = fileService.openWriteChannel(newBlob, lock);
// increase the buffer size as you are reading from the
// input stream. Read the input stream into buffer
for (int n; (n = stream.read(buffer)) != -1; ){
writeChannel.write(ByteBuffer.wrap(buffer));
}
stream.close();
writeChannel.closeFinally();
BlobKey blobKey = fileService.getBlobKey(newBlob);
ImagesService imagesService = ImagesServiceFactory.getImagesService();
As you may tell, I'm using lower level code for receiving an upload from a user (instead of using getUploadUrl.
One difference between my datastore on deployment and my datastore in dev is that I see a BlobFileIndex entity kind in the datastore for my dev.
Thank you for any input!