我正在尝试通过谷歌云语音API,看看他们将韩语转换为文本的准确性。
我的操作系统是Windwos10,使用Eclipse和Maven。我现在正在尝试构建Maven。但是,我不断收到相同的错误。我用谷歌搜索了一下,但我不知道。
下面是来自 Eclipse 的日志。
Exception in thread "grpc-default-executor-1" java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:153)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:130)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:119)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:90)
at io.grpc.netty.NettyChannelBuilder.createProtocolNegotiator(NettyChannelBuilder.java:265)
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(NettyChannelBuilder.java:324)
at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:62)
at io.grpc.internal.TransportSet.startNewTransport(TransportSet.java:215)
at io.grpc.internal.TransportSet.obtainActiveTransport(TransportSet.java:192)
at io.grpc.internal.ManagedChannelImpl$3.getTransport(ManagedChannelImpl.java:651)
at io.grpc.internal.ManagedChannelImpl$3.getTransport(ManagedChannelImpl.java:592)
at io.grpc.DummyLoadBalancerFactory$DummyLoadBalancer$1.get(DummyLoadBalancerFactory.java:135)
at io.grpc.internal.DelayedClientTransport$2.run(DelayedClientTransport.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
4월 12, 2017 10:19:38 오전 io.grpc.internal.ManagedChannelImpl <init>
정보: [ManagedChannelImpl@70e38ce1] Created with target speech.googleapis.com:443
Exception in thread "grpc-default-executor-4" java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:153)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:130)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:119)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:90)
at io.grpc.netty.NettyChannelBuilder.createProtocolNegotiator(NettyChannelBuilder.java:265)
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(NettyChannelBuilder.java:324)
at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:62)
at io.grpc.internal.TransportSet.startNewTransport(TransportSet.java:215)
at io.grpc.internal.TransportSet.obtainActiveTransport(TransportSet.java:192)
at io.grpc.internal.ManagedChannelImpl$3.getTransport(ManagedChannelImpl.java:651)
at io.grpc.internal.ManagedChannelImpl$3.getTransport(ManagedChannelImpl.java:592)
at io.grpc.DummyLoadBalancerFactory$DummyLoadBalancer$1.get(DummyLoadBalancerFactory.java:135)
at io.grpc.internal.DelayedClientTransport$2.run(DelayedClientTransport.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 127.968 sec <<< FAILURE!
test16KHzAudio(googlecloudstt.StreamingRecognizeClientTest) Time elapsed: 64.603 sec <<< FAILURE!
java.lang.AssertionError: Not true that <""> contains <"how old is the Brooklyn Bridge">
at googlecloudstt.StreamingRecognizeClientTest.test16KHzAudio(StreamingRecognizeClientTest.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.AssertionError: Not true that <""> contains <"how old is the Brooklyn Bridge">
at com.google.common.truth.FailureStrategy.fail(FailureStrategy.java:28)
at com.google.common.truth.FailureStrategy.fail(FailureStrategy.java:22)
at com.google.common.truth.Subject.failComparingToStrings(Subject.java:348)
at com.google.common.truth.Subject.fail(Subject.java:325)
at com.google.common.truth.StringSubject.contains(StringSubject.java:126)
... 32 more
test32KHzAudio(googlecloudstt.StreamingRecognizeClientTest) Time elapsed: 63.345 sec <<< FAILURE!
java.lang.AssertionError: Not true that <""> contains <"how old is the Brooklyn Bridge">
at googlecloudstt.StreamingRecognizeClientTest.test32KHzAudio(StreamingRecognizeClientTest.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.AssertionError: Not true that <""> contains <"how old is the Brooklyn Bridge">
at com.google.common.truth.FailureStrategy.fail(FailureStrategy.java:28)
at com.google.common.truth.FailureStrategy.fail(FailureStrategy.java:22)
at com.google.common.truth.Subject.failComparingToStrings(Subject.java:348)
at com.google.common.truth.Subject.fail(Subject.java:325)
at com.google.common.truth.StringSubject.contains(StringSubject.java:126)
... 32 more
Results :
Failed tests: test16KHzAudio(googlecloudstt.StreamingRecognizeClientTest): Not true that <""> contains <"how old is the Brooklyn Bridge">
test32KHzAudio(googlecloudstt.StreamingRecognizeClientTest): Not true that <""> contains <"how old is the Brooklyn Bridge">
Tests run: 5, Failures: 2, Errors: 0, Skipped: 0
只是一个猜测,但当 Jetty 尝试加载不在引导类路径中的类时,看起来会发生这种情况。 看看这个网站:
https://eclipse.org/jetty/documentation/9.3.x/alpn-chapter.html
它指示您需要按如下方式启动 JVM:
java -Xbootclasspath/p:
...