'Google App engine Image transforming Issue from local tomcat server

I am trying to transform images using BlobstoreServiceFactory.

The code is running perfectly on Google cloud app engine. But when I am running the code from local tomcat sever it's throwing the below.

I have set the service account json file in system environment variable. I can read the bucket content from eclipse but while transforming getting the below exception. Please help..

for (StorageObject object : bucketContents) {

// Error coming from this line:

BlobKey blobKey = blobstoreService.createGsBlobKey("/gs/" + bucket + "/" + object.getName());

Image blobImage = ImagesServiceFactory.makeImageFromBlob(blobKey);
Transform resize1 = ImagesServiceFactory.makeResize(width, height);
Image resizeImage1 = imagesService.applyTransform(resize1, blobImage);

}

Exception Details

com.google.apphosting.api.ApiProxy$CallNotFoundException: Can't make API call blobstore.CreateEncodedGoogleStorageKey in a thread that is neither the original request thread nor a thread created by ThreadManager.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source