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 — getLabelAnnotationsList is returning empty map · Issue #2031 · googleapis/google-cloud-java

getLabelAnnotationsList is returning empty map #2031

New issue
Copy link
New issue
Copy link
Closed
Closed
getLabelAnnotationsList is returning empty map#2031
Copy link
Assignees
garrettjonesgoogle
Labels
api: visionIssues related to the Cloud Vision API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@buddhapuneeth
buddhapuneeth
opened on May 3, 2017
Issue body actions

In which file did you encounter the issue?

java-docs-samples/vision/cloud-client/src/main/java/com/example/vision/QuickstartSample.java

Did you change the file? If so, how?

no. running on Tomcat 7 in java 1.8

Describe the issue

EntityAnnotation annotation : res.getLabelAnnotationsList()
there are no items in that. It was working fine some time back, now stopped working. I'm using:
com.google.cloud
google-cloud-vision
0.17.1-beta

Activity

  1. shinfan
    assigned
    gguuss
    on May 8, 2017
  2. shinfan
    added
    api: visionIssues related to the Cloud Vision API.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on May 8, 2017
  3. shinfan commented on May 8, 2017

    @shinfan
    shinfan
    on May 8, 2017
    Contributor
    More actions

    For now gRPC does not support Tomcat well. We should update the doc of supported env #2039

  4. shinfan
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on May 8, 2017
  5. gguuss commented on May 8, 2017

    @gguuss
    gguuss
    on May 8, 2017
    Contributor
    More actions

    I'll see if what I can repro on Tomcat, for my tests, I'm always seeing labels returned from label annotation queries.

  6. garrettjonesgoogle commented on May 31, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on May 31, 2017
    Contributor
    More actions

    @gguuss did you get a chance to repro?

  7. garrettjonesgoogle
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    and removed
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on May 31, 2017
  8. garrettjonesgoogle
    changed the title [-]getLabelAnnotationsList is returing empty map[/-] [+]getLabelAnnotationsList is returning empty map[/+] on May 31, 2017
  9. gguuss commented on May 31, 2017

    @gguuss
    gguuss
    on May 31, 2017
    Contributor
    More actions

    I was actually unable to repro. The following code successfully performs a request from a JSP on tomcat. All you need to do is put a jar containing all the client library dependencies in to the tomcat /lib folder from where you're serving (e.g. mvn compile assembly:single for the cloud-client sample and copy target/vision-google-cloud-samples-1.0.0-jar-with-dependencies.jar into /lib/ for your Tomcat directory. Of note, I'm using Tomcat 8.5.14 installed from homebrew on OSX.

    <%@ page import="com.google.cloud.vision.spi.v1.ImageAnnotatorClient, com.google.cloud.vision.spi.v1.ImageAnnotatorSettings, com.google.cloud.vision.v1.AnnotateImageRequest, com.google.cloud.vision.v1.AnnotateImageResponse, com.google.cloud.vision.v1.BatchAnnotateImagesResponse, com.google.cloud.vision.v1.Block, com.google.cloud.vision.v1.ColorInfo, com.google.cloud.vision.v1.CropHint, com.google.cloud.vision.v1.CropHintsAnnotation, com.google.cloud.vision.v1.DominantColorsAnnotation, com.google.cloud.vision.v1.EntityAnnotation, com.google.cloud.vision.v1.FaceAnnotation, com.google.cloud.vision.v1.Feature, com.google.cloud.vision.v1.Feature.Type, com.google.cloud.vision.v1.Image, com.google.cloud.vision.v1.ImageSource, com.google.cloud.vision.v1.LocationInfo, com.google.cloud.vision.v1.Page, com.google.cloud.vision.v1.Paragraph, com.google.cloud.vision.v1.SafeSearchAnnotation, com.google.cloud.vision.v1.Symbol, com.google.cloud.vision.v1.TextAnnotation, com.google.cloud.vision.v1.WebDetection, com.google.cloud.vision.v1.WebDetection.WebEntity, com.google.cloud.vision.v1.WebDetection.WebImage, com.google.cloud.vision.v1.WebDetection.WebPage, com.google.cloud.vision.v1.Word, com.google.protobuf.ByteString, org.threeten.bp.Duration, java.io.FileInputStream, java.io.IOException, java.io.PrintStream, java.util.ArrayList, java.util.List" %>
    <% String gcsPath = "gs://cloud-samples-tests/vision/face_no_surprise.jpg"; %>
    <html>
      <head>
        <title>
          I know JSP: <%=request.getServletContext().getServerInfo()%>
        </title>
      </head>
      <body>
        <h1>Hello Vision!</h1>
        This is where the action happen.
    <hr>
    Performing face detection on <%=gcsPath%>
    <%
        List<AnnotateImageRequest> reqs = new ArrayList<>();
    
        ImageAnnotatorSettings.Builder imageAnnotatorSettingsBuilder =
            ImageAnnotatorSettings.defaultBuilder();
        imageAnnotatorSettingsBuilder
            .batchAnnotateImagesSettings()
            .getRetrySettingsBuilder()
            .setTotalTimeout(Duration.ofSeconds(30));
        ImageAnnotatorSettings settings = imageAnnotatorSettingsBuilder.build();
    
        ImageSource imgSource = ImageSource.newBuilder().setGcsImageUri(gcsPath).build();
        Image img = Image.newBuilder().setSource(imgSource).build();
        Feature feat = Feature.newBuilder().setType(Type.FACE_DETECTION).build();
    
        AnnotateImageRequest req =
            AnnotateImageRequest.newBuilder().addFeatures(feat).setImage(img).build();
        reqs.add(req);
    
        ImageAnnotatorClient client = ImageAnnotatorClient.create(settings);
        BatchAnnotateImagesResponse resp = client.batchAnnotateImages(reqs);
        List<AnnotateImageResponse> responses = resp.getResponsesList();
    
        for (AnnotateImageResponse res : responses) {
          if (res.hasError()) {
            %>Error!!!! <%=res.getError().getMessage()%><%
            break;
          }
    
          // For full list of available annotations, see http://g.co/cloud/vision/docs
          for (FaceAnnotation annotation : res.getFaceAnnotationsList()) {
            %><p>Anger: <%=annotation.getAngerLikelihood()%><%
            %><p>Joy: <%=annotation.getSurpriseLikelihood()%><%
            %><p>Poly: <%=annotation.getBoundingPoly()%><%
          }
        }
    %>
      </body>
    </html>
    
  10. garrettjonesgoogle commented on Jul 18, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jul 18, 2017
    Contributor
    More actions

    Closing out since we are unable to repro.

  11. garrettjonesgoogle
    closed this as completedon Jul 18, 2017
  12. theacodes
    unassigned
    gguuss
    on Sep 28, 2018
  13. JustinBeckwith
    assigned
    garrettjonesgoogle
    on Feb 1, 2021
  14. chingor13
    added 2 commits that reference this issue on Feb 20, 2026

    fix(bigdecimal): Convert BigDecimal to BigNumeric instead of Numeric (#…

    e0f7e34

    chore(main): release 2.34.0 (#2033)

    40ac0bf
  15. suztomo
    added a commit that references this issue on Mar 23, 2026

    deps: update dependency com.google.cloud:google-cloud-spanner to v6.9…

    35826af
  16. meltsufin
    added 3 commits that reference this issue on Apr 29, 2026

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

    22d8267

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

    0777535

    deps: update dependency com.google.cloud:google-cloud-trace to v2.59.0 (

    50088b0
  17. benjaminp
    added 2 commits that reference this issue on Jul 13, 2026

    feat: Adding feature flags for routing cookie and retry info (googlea…

    450af14

    chore(main): release 2.31.0 (googleapis#2034)

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

Metadata

Metadata

Assignees

  • @garrettjonesgoogle
    garrettjonesgoogle

Labels

api: visionIssues related to the Cloud Vision API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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.