title: Google-Cloud: Jetty ALPN/NPN has not been properly configured
body: <p>Getting exception whilst using Google Pubsub to list topics, my web application is running on tomcat.</p>
  
  <pre><code>public static List&lt;String&gt; listTopics(GcpCredentials gcCredentials, String project) throws GCPException, IOException
  {
      List&lt;String&gt; topics = new ArrayList&lt;&gt;();
      TopicAdminClient client = getTopicClient(gcCredentials);
      ProjectName projectName = ProjectName.create(project);
      ListTopicsPagedResponse response = client.listTopics(projectName);
      for (Topic topic :response.iterateAll())
      {
          topics.add(topic.getNameAsTopicName().getTopic());
      }
      return topics;
  }`
  </code></pre>
  
  <p>Exception:</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.<br/>
        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.createProtocolNegotiatorByType(NettyChannelBuilder.java:335)
        at io.grpc.netty.NettyChannelBuilder.createProtocolNegotiator(NettyChannelBuilder.java:308)
        at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory$DynamicNettyTransportParams.getProtocolNegotiator(NettyChannelBuilder.java:499)
        at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(NettyChannelBuilder.java:448)
        at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:61)
        at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:209)
        at io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:186)
        at io.grpc.internal.ManagedChannelImpl$SubchannelImplImpl.obtainActiveTransport(ManagedChannelImpl.java:806)
        at io.grpc.internal.GrpcUtil.getTransportFromPickResult(GrpcUtil.java:568)
        at io.grpc.internal.DelayedClientTransport.reprocess(DelayedClientTransport.java:296)
        at io.grpc.internal.ManagedChannelImpl$LbHelperImpl$5.run(ManagedChannelImpl.java:724)
        at io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:87)
        at io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:715)
        at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onUpdate(ManagedChannelImpl.java:752)
        at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:174)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)</p>
  </blockquote>