google-cloud-java: java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured. when trying to use PubSub
Hi,
I am trying to use the google cloud libraries to connect to PubSub but I am getting the following exception when trying to execute the following code:
projectID = "XYZ";
subscriptionID = "ABC/XYZ";
subscriptionName = SubscriptionName.create(projectID, subscriptionID);
subscriber = Subscriber.defaultBuilder(subscriptionName, new MessageReceiverEx()).build();
subscriber.startAsync().awaitRunning();
Caused by: java.lang.IllegalStateException: Expected the service InnerService [FAILED] to be RUNNING, but the service has FAILED
at com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:328)
at com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:266)
at com.google.api.core.AbstractApiService.awaitRunning(AbstractApiService.java:97)
at ...
Caused by: java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:174)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:151)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:139)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:109)
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.<init>(NettyChannelBuilder.java:470)
at io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:338)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:305)
at com.google.api.gax.grpc.InstantiatingChannelProvider.createChannel(InstantiatingChannelProvider.java:125)
at com.google.api.gax.grpc.InstantiatingChannelProvider.getChannel(InstantiatingChannelProvider.java:110)
at com.google.cloud.pubsub.v1.Subscriber.doStart(Subscriber.java:239)
at com.google.api.core.AbstractApiService$InnerService.doStart(AbstractApiService.java:149)
at com.google.common.util.concurrent.AbstractService.startAsync(AbstractService.java:211)
at com.google.api.core.AbstractApiService.startAsync(AbstractApiService.java:121)
at com.google.cloud.pubsub.v1.Subscriber.startAsync(Subscriber.java:228)
The last line in my code (subscriber.startAsync().awaitRunning();
) is the position where the upper exception origines from.
Am I using something wrong or is this a bug?
I am using compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version:'0.22.0-beta'
as gradle dependency.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (14 by maintainers)
What system are you using? I had similar problem but because of alpine linux
Google libs bring in: netty-tcnative-boringssl-static 1.1.33.Fork26 which is incompatible with the 2.x.x of netty-tcnative
I’ll ask the client library team if they can shade or upgrade this stuff.