GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Google App engine Image transforming Issue from local tomcat server · Issue #702 · GoogleCloudPlatform/java-docs-samples

Google App engine Image transforming Issue from local tomcat server #702

New issue
Copy link
New issue
Copy link
Closed
Closed
Google App engine Image transforming Issue from local tomcat server#702
Copy link
Assignees
kurtisvg

Description

@yasikmondal
yasikmondal
opened on Jun 13, 2017
Issue body actions

Hi Team,

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.

Reacted by Ivan A Sanchez V

Activity

Next
  1. lesv commented on Jun 13, 2017

    @lesv
    lesv
    on Jun 13, 2017
    Contributor
    More actions

    These apis are meant to be called from App Engine or from the development environment. For Image transformation on your own Tomcat server, you might wish to use a java image transform library.

    Reacted by JAVA/J2EE Application Architect and Alex
  2. lesv
    closed this as completedon Jun 13, 2017
  3. yasikmondal commented on Jun 13, 2017

    @yasikmondal
    yasikmondal
    on Jun 13, 2017
    Author
    More actions

    I am deploying my application on tomcat but getting the image object from google cloud storage bucket.

    In that case which library I need to use in my application (in eclipse) java image transform library or Google Cloud App engine library ?

  4. lesv commented on Jun 13, 2017

    @lesv
    lesv
    on Jun 13, 2017
    Contributor
    More actions

    Since you are running your app on your machine you will want to use something like: https://stackoverflow.com/questions/5895829/resizing-image-in-java

  5. yasikmondal commented on Jun 14, 2017

    @yasikmondal
    yasikmondal
    on Jun 14, 2017
    Author
    More actions

    Thanks lesv.. but before that I have to get the image from cloud bucket and for that I am using this method which is not giving the actual image.

    public static List<StorageObject> listBucket(String bucketName) throws IOException, GeneralSecurityException {
    		Storage client = StorageFactory.getService();
    		System.out.print(bucketName);
    		Storage.Objects.List listRequest = client.objects().list(bucketName);
    		System.out.print("******* " + listRequest+ "**********");
    		List<StorageObject> results = new ArrayList<StorageObject>();
    		Objects objects;
    
    		// Iterate through each page of results, and add them to our results
    		// list.
    		do {
    			objects = listRequest.execute();
    			// Add the items in this page of results to the list we'll return.
    			results.addAll(objects.getItems());
    
    			// Get the next page, in the next iteration of this loop.
    			listRequest.setPageToken(objects.getNextPageToken());
    		} while (null != objects.getNextPageToken());
    
    		return results;
    	}
    

    Can please let me know how to get the actual image from cloud bucket if I am not using app engine library.

  6. lesv commented on Jun 14, 2017

    @lesv
    lesv
    on Jun 14, 2017
    Contributor
    More actions

    You might wish to use some older apis [docs] [example]

  7. yasikmondal commented on Jun 24, 2017

    @yasikmondal
    yasikmondal
    on Jun 24, 2017
    Author
    More actions

    Lesv do we have any tutorial in java for object change notification. I am running my application on cloud app engine and need to add this feature as well. Please share some tutorial link so that I can check and implement.

  8. lesv commented on Jun 25, 2017

    @lesv
    lesv
    on Jun 25, 2017
    Contributor
    More actions

    Take a look at Object-Change-Notifications -- There is a python example. (of course, now there are pub/sub notifications)

    As I remember, the key things about setting up object-change-notification is that you need to have the endpoint setup to respond to the requests before you create the request.

  9. yasikmondal commented on Jun 27, 2017

    @yasikmondal
    yasikmondal
    on Jun 27, 2017
    Author
    More actions

    @lesv : Do you have any example with source code (in JAVA). so that I can check.

  10. lesv commented on Jun 28, 2017

    @lesv
    lesv
    on Jun 28, 2017
    Contributor
    More actions

    On GAE standard, Flex, or somewhere else? I'll add it to the todo list for next Q.

  11. lesv
    reopened this on Jun 28, 2017
  12. lesv
    added
    enhancement
    on Jun 28, 2017
  13. yasikmondal commented on Jul 14, 2017

    @yasikmondal
    yasikmondal
    on Jul 14, 2017
    Author
    More actions

    @lesv I am running my code on GAE . Do you have any update for this Enhancement in Java?

  14. lesv commented on Jul 17, 2017

    @lesv
    lesv
    on Jul 17, 2017
    Contributor
    More actions

    With Tomcat, it's probably GAE Flexible, as GAE Standard uses Jetty as it's servlet container. It's reasonable to have a sample, I'm still scheduling the Q, will know more later this week.

  15. yasikmondal commented on Aug 1, 2017

    @yasikmondal
    yasikmondal
    on Aug 1, 2017
    Author
    More actions

    @lesv any update on this ? do we have any sample..

  16. 6 remaining items

  17. kurtisvg commented on Jun 10, 2019

    @kurtisvg
    kurtisvg
    on Jun 10, 2019
    Contributor
    More actions

    Notice: this issue has been closed because it has been inactive for 652 days. You may reopen this issue if it has been closed in error.

  18. kurtisvg
    closed this as completedon Jun 10, 2019
  19. ivanmkc
    added a commit that references this issue on Nov 3, 2022

    chore(deps): update dependency com.google.cloud:google-cloud-datalabe…

    be50a71
  20. averikitsch
    added a commit that references this issue on Nov 9, 2022

    chore(deps): update dependency com.google.cloud:google-cloud-datalabe…

    1f3c91e
  21. Shabirmean
    added 4 commits that reference this issue on Nov 14, 2022

    deps: update dependency com.google.cloud:google-cloud-core to v2.1.3 (#…

    7ce4397

    deps: update dependency com.google.cloud:google-cloud-core to v2.1.3 (#…

    f22b056

    deps: update dependency com.google.cloud:google-cloud-core to v2.1.7 (#…

    62ac530

    chore(deps): update dependency com.google.cloud:libraries-bom to v23.…

    6ca35f2
  22. gcf-merge-on-green
    added a commit that references this issue on Nov 17, 2022

    samples: migrate code from googleapis/java-speech (#7437)

    6161d0f
  23. Shabirmean
    added a commit that references this issue on Nov 18, 2022

    chore(deps): update dependency com.google.cloud:google-cloud-aiplatfo…

    6f6c83f
  24. gcf-merge-on-green
    added a commit that references this issue on Nov 18, 2022

    samples: migrate code from googleapis/java-vision (#7428)

    bc0bd72
  25. anguillanneuf
    added a commit that references this issue on Dec 5, 2022

    samples: migrate code from googleapis/java-vision (#7428)

    29117e9
  26. gcf-merge-on-green
    added a commit that references this issue on Dec 20, 2022

    samples: migrate code from googleapis/java-aiplatform (#7451)

    24b693d
  27. Sita04
    added 2 commits that reference this issue on Feb 7, 2023

    deps: update dependency com.google.cloud:google-cloud-pubsub to v1.11…

    531e95a

    chore: release 3.0.11 (#703)

    8f803d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kurtisvg
    kurtisvg

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.