作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 GGoogle Text to Speech API 时出现以下异常,
java.lang.IllegalStateException: Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available
at i.g.n.s.io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:233)
at i.g.n.s.io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
at i.g.n.s.io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
at i.g.n.s.i.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:397)
at i.g.i.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:513)
at c.g.a.g.g.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:304)
at c.g.a.g.g.InstantiatingGrpcChannelProvider.access$1500(InstantiatingGrpcChannelProvider.java:71)
at c.g.a.g.g.InstantiatingGrpcChannelProvider$1.createSingleChannel(InstantiatingGrpcChannelProvider.java:202)
at com.google.api.gax.grpc.ChannelPool.create(ChannelPool.java:72)
at c.g.a.g.g.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:209)
at c.g.a.g.g.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:192)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:155)
at c.g.c.t.v1.stub.GrpcTextToSpeechStub.create(GrpcTextToSpeechStub.java:74)
at c.g.c.t.v1.stub.TextToSpeechStubSettings.createStub(TextToSpeechStubSettings.java:100)
at c.g.c.texttospeech.v1.TextToSpeechClient.<init>(TextToSpeechClient.java:128)
at c.g.c.texttospeech.v1.TextToSpeechClient.create(TextToSpeechClient.java:109)
at c.g.c.texttospeech.v1.TextToSpeechClient.create(TextToSpeechClient.java:101)
at com.vxml.util.GoogleTTSUtil.getSpeech(GoogleTTSUtil.scala:11)
at com.vxml.util.GoogleTTSUtil.getSpeech$(GoogleTTSUtil.scala:10)
at com.VxmlActivitiesMain$.getSpeech(VxmlActivitiesMain.scala:22)
at com.vxml.rest.TTSRoute.$anonfun$ttsRoute$2(TTSRoute.scala:35)
at akka.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$2(...
使用了以下 sbt 依赖项,
val googleTTS = "com.google.cloud" % "google-cloud-texttospeech" % "1.0.2"
val googleLibraries = "com.google.cloud" % "libraries-bom" % "4.4.1"
val googleGrpc = "com.google.api" % "gax-grpc" % "1.56.0"
val nettyShaded = "io.grpc" % "grpc-netty-shaded" % "1.28.1"
val nettyTcnativeBoringSsl = "io.netty" % "netty-tcnative-boringssl-static" % "2.0.20.Final"
使用的 Docker 基础镜像:openjdk:8u212-jdk-alpine
最佳答案
此链接https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty说:
io.grpc:grpc-netty-shaded includes the proper version of Netty and netty-tcnative-boringssl-static in a way that won't conflict with other Netty usages.
您可以尝试删除自己的 nettyTcnativeBoringSsl
依赖项并查看是否可以解决问题吗?
关于java - 使用 google texttospeech : Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt 时出错,或 Jetty NPN/ALPN 可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61934116/
我是一名优秀的程序员,十分优秀!