Skip to content

NoSuchMethodError while using cloud pubsub java client #2710

Description

@premkumar-masilamani

Hi - I am new to GCP. I am trying to integrate java app with cloud pubsub emulator. I use java 8 on Windows 10 machine. I simply added the below dependency to pom and ran the example program CreateSubscriptionAndConsumeMessages.

<dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-pubsub</artifactId>
            <version>0.32.0-beta</version>
        </dependency>

I get the below error. Shouldn't all the dependencies be managed by google java client?. If there are exceptions, please document it.

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Throwables.throwIfInstanceOf(Ljava/lang/Throwable;Ljava/lang/Class;)V
	at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:56)
	at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
	at com.google.cloud.pubsub.v1.SubscriptionAdminClient.createSubscription(SubscriptionAdminClient.java:282)
	at com.google.cloud.pubsub.v1.SubscriptionAdminClient.createSubscription(SubscriptionAdminClient.java:250)
	at io.flux.modelservice.subscribers.CreateSubscriptionAndConsumeMessages.main(CreateSubscriptionAndConsumeMessages.java:24)

Activity

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

Metadata

Metadata

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