gpt4 book ai didi

java - 使用 google texttospeech : Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt 时出错,或 Jetty NPN/ALPN 可用

转载 作者:行者123 更新时间:2023-12-01 16:36:44 25 4
gpt4 key购买 nike

使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com