java.lang.IllegalArgumentException:尚未正确配置Jetty ALPN / NPN

获取java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured ,同时使用gRPC(google pub/sub)发布/使用来自Kafka的消息。

尝试在netty-tcnative-boringssl-static上添加运行时依赖项。 请参阅gRPC的 。 请注意,netty-tcnative的版本随时间变化; 您应该查看特定版本的文档版本(例如, 这是针对1.2.0 )。


 1. As suggested by google, use jetty container instead of tomcat, this solution works, but in our production, applications deployed on tomcat container. – No from team 2. On debugging the gRPC code, found that guava version causing the issue, updated the guava version 18.0, (where in some classes missed in previous versions) , solved the problem , but failed while deploying in CF 3. Customized emebed-tomcat-core, and it works fine consistently – but team say no to custom tomcat container. 4. Java –jar apm-asset-xxxx.jar – works fine locally, but need to provide a custom command to CF start, didn't have luxury to change the CF start process. 5. Finally, trick, the class loader to use tcnative-boring-ssl, library instead of tomcat-core library at runtime, by providing the following dependency in pom.xml. From past 3 days, this solution is working CF.  org.springframework.boot spring-boot-starter-web   org.hibernate *   org.apache.tomcat.embed tomcat-embed-core     org.apache.tomcat.embed tomcat-embed-core provided  6. Maven manifest plugin to promote the tc-native library to the top in the classloader. 

最后,回到引导类类路径的方法。 将jetty-alpn.jar作为引导类路径的前缀,现在它在云代工厂开始正常工作。

添加与我的JDK版本匹配的ALPN客户端JAR为我解决了这个问题。 在eclipse中,您需要将jar设置为tomcat服务器的引导条目。

你可以在这里找到更多相关信息: https : //

在POM中,尝试在spring boot依赖项之前放置gRPC依赖项(依赖项的顺序很重要)。 我这样做了,问题就解决了。 例如: google-cloud-language 0.13.0-beta   org.springframework.boot spring-boot-starter-web