java.lang.IllegalArgumentException: Jetty ALPN/NPN 尚未正确配置 [英] java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured
问题描述
获取 java.lang.IllegalArgumentException: Jetty ALPN/NPN 未正确配置
,同时使用 gRPC(google pub/sub)
发布/使用来自 <强>卡夫卡.
Getting java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured
, while using gRPC(google pub/sub)
to publish/consumes messages from Kafka.
推荐答案
- 按照谷歌的建议,使用 jetty 容器而不是 tomcat,此解决方案有效,但在我们的生产中,应用程序部署在 tomcat 容器上,但当然我需要它在生产中使用 tomcat.
- 调试gRPC代码,发现guava版本导致问题,更新了guava 18.0版本,(之前版本漏掉了一些类),问题解决,但是在CF中部署失败
- 定制的 emebed-tomcat-core,它始终运行良好,但团队再次拒绝定制 tomcat 容器.
Java –jar apm-asset-xxxx.jar
– 在本地工作正常,但需要提供自定义命令来启动 CF,没有奢侈更改 CF 启动过程.立>最后,通过在 pom.xml 中提供以下依赖项,让类加载器在运行时使用 tcnative-boring-ssl 库而不是 tomcat-core 库.在过去的 3 天里,此解决方案在 CF 中有效.
- As suggested by google, use jetty container instead of tomcat, this solution works, but in our production, applications deployed on tomcat container, but of course I need it to work on tomcat in production.
- 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
- Customized emebed-tomcat-core, and it works fine consistently, but again, team say no to custom tomcat container.
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.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. For the past 3 days, this solution is working CF.
org.springframework.bootspring-boot-starter-weborg.hibernate*org.apache.tomcat.embedtomcat-embed-coreorg.apache.tomcat.embedtomcat-embed-core假如
org.springframework.boot spring-boot-starter-web org.hibernate * org.apache.tomcat.embed tomcat-embed-core org.apache.tomcat.embed tomcat-embed-core provided
Maven 清单插件,用于将 tc-native 库提升到类加载器的顶部.
Maven manifest plugin to promote the tc-native library to the top in the classloader.
这篇关于java.lang.IllegalArgumentException: Jetty ALPN/NPN 尚未正确配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!