Repository navigation
java.lang.IllegalArgumentException: ALPN is not configured properly. #3036
Description
Activity
It might help, here's my working piece of dependencies as mentioned in grpc-security-table
// version table at https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty google-cloud-core:1.15.0(one lesser version than yours) grpc-netty:1.9.0 netty-handler:4.1.17.Final netty-tcnative-boringssl-static:2.0.7.FinalI simply build the war artifact and deploy to tomcat 8 without issues on Mac or Linux.
[INFO] com.nlu:nlu-service:war:1.0-SNAPSHOT [INFO] +- com.nlu:nlu-client:jar:1.0-SNAPSHOT:compile [INFO] +- com.nlu.nlu-data-provider-client:jar:1.0.153:compile [INFO] | \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile [INFO] +- org.scala-lang:scala-library:jar:2.12.4:compile [INFO] +- org.scala-lang.modules:scala-java8-compat_2.12:jar:0.8.0:compile [INFO] +- org.scala-lang.modules:scala-parser-combinators_2.12:jar:1.0.4:compile [INFO] +- com.typesafe.akka:akka-http_2.12:jar:10.0.10:compile [INFO] | \- com.typesafe.akka:akka-http-core_2.12:jar:10.0.10:compile [INFO] | \- com.typesafe.akka:akka-parsing_2.12:jar:10.0.10:compile [INFO] +- com.typesafe.akka:akka-stream_2.12:jar:2.5.6:compile [INFO] | +- com.typesafe.akka:akka-actor_2.12:jar:2.5.6:compile [INFO] | | \- com.typesafe:config:jar:1.3.1:compile [INFO] | +- org.reactivestreams:reactive-streams:jar:1.0.1:compile [INFO] | \- com.typesafe:ssl-config-core_2.12:jar:0.2.2:compile [INFO] +- com.typesafe.akka:akka-slf4j_2.12:jar:2.5.6:compile [INFO] | \- org.slf4j:slf4j-api:jar:1.8.0-beta1:compile [INFO] +- com.fasterxml.jackson.module:jackson-module-scala_2.12:jar:2.8.5:compile [INFO] | +- org.scala-lang:scala-reflect:jar:2.12.0:compile [INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.8.5:compile [INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.5:compile [INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.5:compile [INFO] | \- com.fasterxml.jackson.module:jackson-module-paranamer:jar:2.8.5:compile [INFO] | \- com.thoughtworks.paranamer:paranamer:jar:2.8:compile [INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.8.5:compile [INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.5:compile [INFO] +- org.springframework:spring-core:jar:4.3.10.RELEASE:compile [INFO] | \- commons-logging:commons-logging:jar:1.2:compile [INFO] +- org.springframework:spring-context:jar:4.3.10.RELEASE:compile [INFO] | +- org.springframework:spring-aop:jar:4.3.10.RELEASE:compile [INFO] | +- org.springframework:spring-beans:jar:4.3.10.RELEASE:compile [INFO] | \- org.springframework:spring-expression:jar:4.3.10.RELEASE:compile [INFO] +- org.springframework:spring-context-support:jar:4.3.10.RELEASE:compile [INFO] +- org.springframework:spring-web:jar:4.3.10.RELEASE:compile [INFO] +- org.springframework:spring-webmvc:jar:4.3.10.RELEASE:compile [INFO] +- org.springframework:spring-test:jar:4.3.10.RELEASE:test [INFO] +- org.apache.logging.log4j:log4j-1.2-api:jar:2.10.0:compile [INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile [INFO] | \- org.apache.logging.log4j:log4j-core:jar:2.10.0:compile [INFO] +- com.google.guava:guava:jar:20.0:compile [INFO] +- com.google.cloud:google-cloud-dialogflow:jar:0.33.0-alpha:compile [INFO] | +- io.netty:netty-tcnative-boringssl-static:jar:2.0.7.Final:compile [INFO] | +- com.google.cloud:google-cloud-core:jar:1.15.0:compile [INFO] | | +- joda-time:joda-time:jar:2.9.2:compile [INFO] | | +- com.google.http-client:google-http-client:jar:1.23.0:compile [INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.1:compile [INFO] | | +- com.google.api:api-common:jar:1.2.0:compile [INFO] | | +- com.google.api:gax:jar:1.16.0:compile [INFO] | | | +- com.google.auto.value:auto-value:jar:1.2:compile [INFO] | | | +- org.threeten:threetenbp:jar:1.3.3:compile [INFO] | | | \- com.google.auth:google-auth-library-oauth2-http:jar:0.9.0:compile [INFO] | | | \- com.google.http-client:google-http-client-jackson2:jar:1.19.0:compile [INFO] | | +- com.google.protobuf:protobuf-java-util:jar:3.5.1:compile [INFO] | | | \- com.google.code.gson:gson:jar:2.7:compile [INFO] | | +- com.google.api.grpc:proto-google-common-protos:jar:1.0.4:compile [INFO] | | \- com.google.api.grpc:proto-google-iam-v1:jar:0.1.28:compile [INFO] | +- com.google.cloud:google-cloud-core-grpc:jar:1.15.0:compile [INFO] | | +- com.google.auth:google-auth-library-credentials:jar:0.9.0:compile [INFO] | | +- com.google.protobuf:protobuf-java:jar:3.5.1:compile [INFO] | | +- io.grpc:grpc-protobuf:jar:1.9.0:compile [INFO] | | | \- io.grpc:grpc-protobuf-lite:jar:1.9.0:compile [INFO] | | +- io.grpc:grpc-context:jar:1.9.0:compile [INFO] | | \- com.google.api:gax-grpc:jar:1.16.0:compile [INFO] | +- com.google.api.grpc:proto-google-cloud-dialogflow-v2beta1:jar:0.1.28:compile [INFO] | +- io.grpc:grpc-netty:jar:1.9.0:compile [INFO] | | +- io.grpc:grpc-core:jar:1.9.0:compile (version selected from constraint [1.9.0,1.9.0]) [INFO] | | | +- com.google.errorprone:error_prone_annotations:jar:2.1.2:compile [INFO] | | | +- com.google.instrumentation:instrumentation-api:jar:0.4.3:compile [INFO] | | | +- io.opencensus:opencensus-api:jar:0.10.0:compile [INFO] | | | \- io.opencensus:opencensus-contrib-grpc-metrics:jar:0.10.0:compile [INFO] | | +- io.netty:netty-codec-http2:jar:4.1.17.Final:compile (version selected from constraint [4.1.17.Final,4.1.17.Final]) [INFO] | | | +- io.netty:netty-codec-http:jar:4.1.17.Final:compile [INFO] | | | | \- io.netty:netty-codec:jar:4.1.17.Final:compile [INFO] | | | \- io.netty:netty-handler:jar:4.1.17.Final:compile [INFO] | | | \- io.netty:netty-buffer:jar:4.1.17.Final:compile [INFO] | | | \- io.netty:netty-common:jar:4.1.17.Final:compile [INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.17.Final:compile [INFO] | | +- io.netty:netty-transport:jar:4.1.17.Final:compile [INFO] | | | \- io.netty:netty-resolver:jar:4.1.17.Final:compile [INFO] | | \- io.netty:netty-codec-socks:jar:4.1.17.Final:compile [INFO] | +- io.grpc:grpc-stub:jar:1.9.0:compile [INFO] | \- io.grpc:grpc-auth:jar:1.9.0:compile [INFO] +- kr.motd.maven:os-maven-plugin:jar:1.5.0.Final:compile [INFO] | +- org.apache.maven:maven-plugin-api:jar:3.2.1:compile [INFO] | | +- org.apache.maven:maven-model:jar:3.2.1:compile [INFO] | | +- org.apache.maven:maven-artifact:jar:3.2.1:compile [INFO] | | \- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M5:compile [INFO] | | +- javax.enterprise:cdi-api:jar:1.0:compile [INFO] | | | +- javax.annotation:jsr250-api:jar:1.0:compile [INFO] | | | \- javax.inject:javax.inject:jar:1:compile [INFO] | | +- org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile [INFO] | | | \- aopalliance:aopalliance:jar:1.0:compile [INFO] | | +- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:compile [INFO] | | +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile [INFO] | | \- org.codehaus.plexus:plexus-classworlds:jar:2.4:compile [INFO] | \- org.codehaus.plexus:plexus-utils:jar:3.0.17:compile [INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.52:compile [INFO] | | +- org.aspectj:aspectjrt:jar:1.8.5:compile [INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.5:compile [INFO] | +- org.codehaus.groovy.modules.http-builder:http-builder:jar:0.7.1:compile [INFO] | | +- net.sf.json-lib:json-lib:jar:jdk15:2.3:compile [INFO] | | | +- commons-beanutils:commons-beanutils:jar:1.8.0:compile [INFO] | | | +- commons-collections:commons-collections:jar:3.2.1:compile [INFO] | | | +- commons-lang:commons-lang:jar:2.4:compile [INFO] | | | \- net.sf.ezmorph:ezmorph:jar:1.0.6:compile [INFO] | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.16:compile [INFO] | | | \- xerces:xercesImpl:jar:2.9.1:compile [INFO] | | | \- xml-apis:xml-apis:jar:1.3.04:compile [INFO] | | \- xml-resolver:xml-resolver:jar:1.2:compile [INFO] | +- org.apache.httpcomponents:httpclient:jar:4.4.1:compile [INFO] | | \- org.apache.httpcomponents:httpcore:jar:4.4.1:compile [INFO] | +- org.spockframework:spock-core:jar:1.0-groovy-2.4:test [INFO] | | \- junit:junit:jar:4.12:test [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.3:test [INFO] | +- org.spockframework:spock-spring:jar:1.0-groovy-2.4:test [INFO] | +- cglib:cglib-nodep:jar:3.2.0:test [INFO] | +- org.objenesis:objenesis:jar:2.1:compile [INFO] | +- commons-net:commons-net:jar:2.0:test [INFO] | +- xmlunit:xmlunit:jar:1.6:test [INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.62:test [INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-log4j:jar:7.0.62:test [INFO] | \- org.apache.tomcat.embed:tomcat-embed-jasper:jar:7.0.62:test [INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:7.0.62:test [INFO] | \- org.eclipse.jdt.core.compiler:ecj:jar:4.4.2:test [INFO] | | | +- com.esotericsoftware:kryo:jar:3.0.3:compile [INFO] | | | | +- com.esotericsoftware:reflectasm:jar:1.10.1:compile [INFO] | | | | \- com.esotericsoftware:minlog:jar:1.3.0:compile [INFO] | | | +- de.javakaffee:kryo-serializers:jar:0.37:compile [INFO] | | | +- net.sf.ehcache:ehcache:jar:2.9.1:compile [INFO] | | | +- com.codahale.metrics:metrics-core:jar:3.0.2:compile [INFO] | | | +- javax.transaction:jta:jar:1.1:compile [INFO] | | | +- net.spy:spymemcached:jar:2.12.1:compile [INFO] | | | +- kr.pe.kwonnam.spymemcached-extra-transcoders:kryo-transcoder:jar:0.1:compile [INFO] | | | | \- kr.pe.kwonnam.spymemcached-extra-transcoders:spymemcached-extra-transcoders-core:jar:0.1:compile [INFO] | | | +- kr.pe.kwonnam.spymemcached-extra-transcoders:gzip-compress-transcoder:jar:0.1:compile [INFO] | | | +- org.springframework:spring-aspects:jar:4.1.5.RELEASE:compile [INFO] | | | \- net.openhft:zero-allocation-hashing:jar:0.8:compile [INFO] | | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.2:compile [INFO] | | | \- org.apache.httpcomponents:httpcore-nio:jar:4.4.5:compile [INFO] | | \- org.apache.shiro:shiro-core:jar:1.2.3:compile [INFO] | +- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile [INFO] | +- io.dropwizard.metrics:metrics-httpclient:jar:3.1.2:compile [INFO] | \- io.dropwizard.metrics:metrics-jersey2:jar:3.1.0:compile [INFO] | +- io.dropwizard.metrics:metrics-annotation:jar:3.1.0:compile [INFO] | \- org.glassfish.jersey.core:jersey-server:jar:2.11:compile [INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.11:compile [INFO] | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.11:compile [INFO] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile [INFO] | +- org.glassfish.jersey.core:jersey-client:jar:2.11:compile [INFO] | +- javax.annotation:javax.annotation-api:jar:1.2:compile [INFO] | +- org.glassfish.hk2:hk2-api:jar:2.3.0-b05:compile [INFO] | | +- org.glassfish.hk2:hk2-utils:jar:2.3.0-b05:compile [INFO] | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.3.0-b05:compile [INFO] | +- org.glassfish.hk2.external:javax.inject:jar:2.3.0-b05:compile [INFO] | +- org.glassfish.hk2:hk2-locator:jar:2.3.0-b05:compile [INFO] | | \- org.javassist:javassist:jar:3.18.1-GA:compile [INFO] | \- javax.validation:validation-api:jar:1.1.0.Final:compile [INFO] | +- org.jasypt:jasypt:jar:1.9.2:compile [INFO] | \- org.projectlombok:lombok:jar:1.16.8:compile [INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided [INFO] +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.5:compile [INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.5:compile [INFO] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.5:compile [INFO] +- com.typesafe.akka:akka-testkit_2.12:jar:2.5.6:test [INFO] +- org.scalatest:scalatest_2.12:jar:3.0.4:test [INFO] | +- org.scalactic:scalactic_2.12:jar:3.0.4:test [INFO] | \- org.scala-lang.modules:scala-xml_2.12:jar:1.0.5:test [INFO] +- org.scalamock:scalamock-scalatest-support_2.12:jar:3.6.0:test [INFO] | \- org.scalamock:scalamock-core_2.12:jar:3.6.0:test [INFO] +- org.scalamock:scalamock_2.12:jar:3.6.0:test [INFO] +- org.mockito:mockito-all:jar:1.9.5:test [INFO] +- com.jayway.jsonpath:json-path:jar:2.2.0:test [INFO] | \- net.minidev:json-smart:jar:2.2.1:test [INFO] | \- net.minidev:accessors-smart:jar:1.1:test [INFO] \- com.storm-enroute:scalameter_2.12:jar:0.9:test [INFO] +- com.storm-enroute:scalameter-core_2.12:jar:0.9:test [INFO] | +- org.apache.commons:commons-lang3:jar:3.4:test [INFO] | \- org.ow2.asm:asm:jar:5.0.4:compile [INFO] +- org.apache.commons:commons-math3:jar:3.2:test [INFO] +- org.scala-tools.testing:test-interface:jar:0.5:test [INFO] +- org.mongodb.scala:mongo-scala-driver_2.12:jar:2.2.0:test [INFO] | +- org.mongodb.scala:mongo-scala-bson_2.12:jar:2.2.0:test [INFO] | \- org.mongodb:mongodb-driver-async:jar:3.6.0:test [INFO] | +- org.mongodb:bson:jar:3.6.0:test [INFO] | \- org.mongodb:mongodb-driver-core:jar:3.6.0:test [INFO] +- commons-io:commons-io:jar:2.4:compile [INFO] \- io.spray:spray-json_2.12:jar:1.3.2:test
So your project is using
grpc-nettyand mine is usinggrpc-netty-shaded... I am not sure if that makes a difference.EDIT: I excluded
grpc-netty-shaded, replaced it with your version ofgrpc-nettyand it didn't fix it. I will keep looking for clues in your maven list, though.garrettjonesgoogle commented
on Mar 14, 2018 ContributorMore actions@danostrowski your particular docker image might be a particular platform where boringssl doesn't work. Could you try running https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-util/google-cloud-compat-checker in your docker image and pasting the result here?
It turns out the docker image we're using was using
musl:( Thanks for the help.I am using google-cloud-vision with Java 8. It works fine on mac os. However when I tried on Linux
getting exceptions
java.lang.IllegalArgumentException: ALPN is not configured properly. See https://github.com/grpc/grpc-java/blob/master/SECURITY.md#troubleshooting for more information.
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:166)
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:136)
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:124)
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:94)
at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder$NettyTransportFactory$DefaultNettyTransportCreationParamsFilterFactory.(NettyChannelBuilder.java:546)
at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder$NettyTransportFactory$DefaultNettyTransportCreationParamsFilterFactory.(NettyChannelBuilder.java:539)
at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.(NettyChannelBuilder.java:477)
at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:325)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:362)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:206)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:157)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:149)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:151)
at com.google.cloud.vision.v1.stub.GrpcImageAnnotatorStub.create(GrpcImageAnnotatorStub.java:84)
at com.google.cloud.vision.v1.stub.ImageAnnotatorStubSettings.createStub(ImageAnnotatorStubSettings.java:120)
at com.google.cloud.vision.v1.ImageAnnotatorClient.(ImageAnnotatorClient.java:136)
at com.google.cloud.vision.v1.ImageAnnotatorClient.create(ImageAnnotatorClient.java:117)
at com.hp.wex.utilities.FileDirStringOp.getOcrText(FileDirStringOp.java:250)
at com.hp.wex.MainApp.main(MainApp.java:203)
Caused by: java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at io.grpc.netty.shaded.io.grpc.netty.JettyTlsUtil.isJettyAlpnConfigured(JettyTlsUtil.java:64)
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:153)
... 18 more
can any one help me with this?Why am I being assigned this closed ticket? I don't belong to the project and I resolved it with an explanation of the issue I'm having.
- added a commit that references this issue
on Feb 20, 2026 - added a commit that references this issue
on Mar 9, 2026 - added a commit that references this issue
on Mar 20, 2026 - added 4 commits that reference this issue
on Mar 24, 2026
Much has been written about this and I've been searching around it all day, but I'm running into the ALPN error when running google-cloud-monitoring.
My maven dependencies are as follows.
My project works locally on Mac in IntelliJ with individual credentials, but when I try to launch it on a GCE instance (CentOS Linux release 7.4.1708 (Core)) in Docker (Docker version 1.13.1, build 774336d/1.13.1), it produces the exception.
Originally, I did not have
netty-handlerornetty-tcnative-boringssl-staticbut I followed the troubleshooting guide at https://github.com/grpc/grpc-java/blob/master/SECURITY.md#troubleshooting and added them.I also, just out of desperation, changed the SpringBoot project to use Jetty instead of Tomcat, even though that should have been fixed in an earlier version of the java/grpc stack.
My understanding was that the new version of google-cloud-monitoring with the
grpc-netty-shadedpackage should have fixed this.