最近几天,当我开始StreamingRecognizeRequests
时,我的ResponseObserver
的{{1}}方法一直收到如下错误:
onError
原谅怪异的格式。我一直在使用Clojure(一种在JVM上运行的语言)进行工作,并且一直在通过Java客户端与Speech API进行交互。
到目前为止,我已经尝试过:
[:error #error {
:cause "com.google.cloud.speech.v1.StreamingRecognitionResult.parseUnknownFieldProto3(Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/UnknownFieldSet$Builder;Lcom/google/protobuf/ExtensionRegistryLite;I)Z"
:via
[{:type com.google.api.gax.rpc.CancelledException
:message "io.grpc.StatusRuntimeException: CANCELLED: Failed to read message."
:at [com.google.api.gax.rpc.ApiExceptionFactory createException "ApiExceptionFactory.java" 43]}
{:type io.grpc.StatusRuntimeException
:message "CANCELLED: Failed to read message."
:at [io.grpc.Status asRuntimeException "Status.java" 526]}
{:type java.lang.NoSuchMethodError
:message "com.google.cloud.speech.v1.StreamingRecognitionResult.parseUnknownFieldProto3(Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/UnknownFieldSet$Builder;Lcom/google/protobuf/ExtensionRegistryLite;I)Z"
:at [com.google.cloud.speech.v1.StreamingRecognitionResult <init> "StreamingRecognitionResult.java" 73]}]
:trace
[[com.google.cloud.speech.v1.StreamingRecognitionResult <init> "StreamingRecognitionResult.java" 73]
[com.google.cloud.speech.v1.StreamingRecognitionResult <init> "StreamingRecognitionResult.java" 14]
[com.google.cloud.speech.v1.StreamingRecognitionResult$1 parsePartialFrom "StreamingRecognitionResult.java" 1098]
[com.google.cloud.speech.v1.StreamingRecognitionResult$1 parsePartialFrom "StreamingRecognitionResult.java" 1092]
[com.google.protobuf.CodedInputStream readMessage "CodedInputStream.java" 497]
[com.google.cloud.speech.v1.StreamingRecognizeResponse <init> "StreamingRecognizeResponse.java" 105]
[com.google.cloud.speech.v1.StreamingRecognizeResponse <init> "StreamingRecognizeResponse.java" 48]
[com.google.cloud.speech.v1.StreamingRecognizeResponse$1 parsePartialFrom "StreamingRecognizeResponse.java" 1466]
[com.google.cloud.speech.v1.StreamingRecognizeResponse$1 parsePartialFrom "StreamingRecognizeResponse.java" 1460]
[com.google.protobuf.AbstractParser parseFrom "AbstractParser.java" 91]
[com.google.protobuf.AbstractParser parseFrom "AbstractParser.java" 49]
[io.grpc.protobuf.lite.ProtoLiteUtils$2 parseFrom "ProtoLiteUtils.java" 179]
[io.grpc.protobuf.lite.ProtoLiteUtils$2 parse "ProtoLiteUtils.java" 171]
[io.grpc.protobuf.lite.ProtoLiteUtils$2 parse "ProtoLiteUtils.java" 88]
[io.grpc.MethodDescriptor parseResponse "MethodDescriptor.java" 266]
[io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable runInContext "ClientCallImpl.java" 519]
[io.grpc.internal.ContextRunnable run "ContextRunnable.java" 37]
[io.grpc.internal.SerializingExecutor run "SerializingExecutor.java" 123]
[java.util.concurrent.Executors$RunnableAdapter call "Executors.java" 511]
[java.util.concurrent.FutureTask run "FutureTask.java" 266]
[java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask access$201 "ScheduledThreadPoolExecutor.java" 180]
[java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask run "ScheduledThreadPoolExecutor.java" 293]
[java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1149]
[java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 624]
[java.lang.Thread run "Thread.java" 748]]}]
更新到[com.google.cloud/google-cloud-speech "0.63.0-beta"]
。0.56.0-beta
的依赖,并将其替换为io.grpc/grpc-core
和[io.grpc/grpc-all "1.16.0"]
[io.grpc/grpc-all "1.15.1"]
代替com.google.cloud.speech.v1
。虽然我的项目一直在开发中,但我不能100%排除我的代码有问题,但我尝试恢复到以前可以正常工作的状态,并遇到了同样的问题。似乎这种错误不太可能是我的代码的错误。如果看起来像是问题的根源,很乐意发布代码(将在Clojure中使用)。
我最好的猜测是:
com.google.cloud.speech.v1p1beta1
无法引入适当的原始依赖性,因此它没有这种[com.google.cloud/google-cloud-speech "0.53.0-beta"]
方法。