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 — PubSub not returning any instance. · Issue #1510 · googleapis/google-cloud-java

PubSub not returning any instance. #1510

New issue
Copy link
New issue
Copy link
Closed
Closed
PubSub not returning any instance.#1510
Copy link
Assignees
garrettjonesgoogle
Labels
api: pubsubIssues related to the Pub/Sub API.

Description

@vaibhavsw
vaibhavsw
opened on Jan 6, 2017
Issue body actions

I'm using Cloud PubSub and trying to get access to the PubSub locally using Service Account JSON credential, but it is not returning anything. Below is the code I'm using to get PubSub instance. Neither it is throwing any exception nor it is returning any PubSub instance. This is an issue which needs to be resolved urgently, anyone can help me.

private PubSub getPubSubForLocal() {

        PubSub pubSub = null;
        InputStream inputStream = getClass().getResourceAsStream("/cloud/vostics-cloud-e56ac878e27e.json");
        try {
            pubSub = PubSubOptions.newBuilder()
                    .setCredentials(ServiceAccountCredentials.fromStream(inputStream))
                    .build()
                    .getService();

        } catch (IOException e) {
            return null;
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        return pubSub;
    }

Activity

Next
  1. garrettjonesgoogle commented on Jan 6, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 6, 2017
    Contributor
    More actions

    Is it throwing an IOException? Your code converts that to null.

  2. vaibhavsw commented on Jan 6, 2017

    @vaibhavsw
    vaibhavsw
    on Jan 6, 2017
    Author
    More actions

    @garrettjonesgoogle It is not throwing any exception either.

  3. vaibhavsw commented on Jan 6, 2017

    @vaibhavsw
    vaibhavsw
    on Jan 6, 2017
    Author
    More actions

    @garrettjonesgoogle Also, in other application it gives an error with code 443.

  4. garrettjonesgoogle commented on Jan 6, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 6, 2017
    Contributor
    More actions

    So I think I need to understand what you mean by "it is not returning anything." Only one of the following is possible:

    1. The return value is null
    2. The return value is a PubSub object
    3. An exception is thrown
    4. The JVM crashes such that the function didn't return

    Which of those is happening?

  5. vaibhavsw commented on Jan 7, 2017

    @vaibhavsw
    vaibhavsw
    on Jan 7, 2017
    Author
    More actions

    @garrettjonesgoogle Alright, this may sound weird because it does to me.

    I've two applications in place and to make them communicate with each other I'm using PubSub, above code is common in both of the application to get an instance of PubSub. In one application it is giving below error:

    07-Jan-2017 12:48:56.238 INFO [RMI TCP Connection(3)-127.0.0.1] io.grpc.internal.ManagedChannelImpl.<init> [ManagedChannelImpl@1d98cfab] Created with target pubsub.googleapis.com:443

    In another application it is not returning anything, now when I'm saying it is not returning anything by that I mean that it is neither throwing any exception nor returning PubSub object.

    I've tried debugging my code and when executing the code, IDE never reaches to any of the exception part.

  6. vaibhavsw commented on Jan 7, 2017

    @vaibhavsw
    vaibhavsw
    on Jan 7, 2017
    Author
    More actions

    @garrettjonesgoogle Can you help me, I need to resolve this ASAP.

  7. garrettjonesgoogle commented on Jan 9, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 9, 2017
    Contributor
    More actions

    Ok I think I should have included another possibility:

    1. One of the function calls hangs, so it never returns.

    Can you use your debugger to step into the google-cloud-java code to see more specifically where it is hanging?

  8. vaibhavsw commented on Jan 10, 2017

    @vaibhavsw
    vaibhavsw
    on Jan 10, 2017
    Author
    More actions

    @garrettjonesgoogle I've solved the previous issue, but now whenever I'm trying to get the topic or create the topic, it is giving me an error saying DEADLINE_EXCEDDED.

  9. garrettjonesgoogle commented on Jan 10, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 10, 2017
    Contributor
    More actions
    1. I'm curious to know if you can say what caused your issue, in case others come across it.
    2. Generally DEADLINE_EXCEEDED is caused by the static netty-tcnative dependency not loading. See DEADLINE_EXCEEDED when using Cloud Pub/Sub library from Compute Engine #1430 for one particular example. I would need to know more about your environment to help you with that. Could you also turn on FINE logging and provide the library loading errors you see?
  10. garrettjonesgoogle
    added
    api: pubsubIssues related to the Pub/Sub API.
    on Jan 11, 2017
  11. vaibhavsw commented on Jan 11, 2017

    @vaibhavsw
    vaibhavsw
    on Jan 11, 2017
    Author
    More actions

    @garrettjonesgoogle

    1. It was the issue with my classpath, input stream wasn't able to find the JSON file.
    2. I've added nitty-all dependency in my project, but still error is there.
  12. garrettjonesgoogle commented on Jan 26, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 26, 2017
    Contributor
    More actions

    @vaibhavswarnkar In order to help with # 2, could you provide the details of your environment (exact OS version & setup in particular), and errors that you see when you set the logging level to FINE?

  13. vaibhavsw commented on Jan 27, 2017

    @vaibhavsw
    vaibhavsw
    on Jan 27, 2017
    Author
    More actions

    @garrettjonesgoogle My problem has been solved. I changed my Spring MVC app to Spring boot app and even after that it wasn't working then I changed the server to jetty server and it worked.

  14. garrettjonesgoogle commented on Jan 27, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 27, 2017
    Contributor
    More actions

    Great! Closing out issue now.

  15. garrettjonesgoogle
    closed this as completedon Jan 27, 2017
  16. 1 remaining item

  17. github-actions
    added a commit that references this issue on Oct 4, 2022

    chore(main): release 2.3.15 (#1519)

    a87b8fc
  18. meltsufin
    added 2 commits that reference this issue on Dec 22, 2025

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    b40e846

    chore(main): release 3.15.16 (#1515)

    f14acdd
  19. chingor13
    added a commit that references this issue on Jan 6, 2026

    chore(main): release 0.132.14-alpha (#1510)

    487e156
  20. chingor13
    added a commit that references this issue on Jan 22, 2026

    chore: skip hermetic generation on fork PRs (#1510)

    c146cab
  21. chingor13
    added a commit that references this issue on Feb 24, 2026

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

    8e321ec
  22. suztomo
    added 2 commits that reference this issue on Mar 11, 2026

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    12ac218

    chore(main): release 3.15.16 (googleapis#1515)

    7255dba
  23. chingor13
    added a commit that references this issue on Mar 12, 2026

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

    11cec5e
  24. lqiu96
    added a commit that references this issue on Mar 20, 2026

    chore(main): release 0.132.14-alpha (#1510)

    58d14d2
  25. suztomo
    added a commit that references this issue on Mar 23, 2026

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

    03ebfa3
  26. suztomo
    added a commit that references this issue on Mar 30, 2026

    chore: mark the unmanaged dependency check required (#1510)

    88bdc14
  27. lqiu96
    added a commit that references this issue on Apr 1, 2026

    chore: mark the unmanaged dependency check required (#1510)

    c12b963
  28. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    0d0ece7

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    69f2663
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: pubsubIssues related to the Pub/Sub API.

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.