我已经将Dialogflow V2 API(DetectIntend)与Springboot集成在一起,并且在我的本地计算机上运行良好。但是,将API调用部署到GCP后失败。在进行了一些研究之后,我添加了以下依存关系,但两者均无济于事。已通过此处https://github.com/grpc/grpc-java/blob/master/SECURITY.md
的指导,但没有解决问题。
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.18.0</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.32.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>2.0.20.Final</version>
</dependency>
请参阅以下堆栈异常。
2019-03-22 14:03:34.756 INFO [conversationservice,ecfde081e153174a22ba98fbf11a4c99,22ba98fbf11a4c99,true] 1 --- [nio-9414-exec-1] i.g.n.s.io.grpc.netty.GrpcSslContexts
: netty-tcnative unavailable (this may be normal)
java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty_tcnative_linux_x86_64, netty_tcnative_linux_x86_64_fedora, netty_tcnative_x86_64, netty_tcnative]
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:104) ~[grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:526) ~[grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:93) ~[grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:244) [grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:171) [grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:120) [grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:385) [grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:435) [grpc-core-1.18.0.jar!/:1.18.0]
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:223) [gax-grpc-1.42.0.jar!/:1.42.0]
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:164) [gax-grpc-1.42.0.jar!/:1.42.0]
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:156) [gax-grpc-1.42.0.jar!/:1.42.0]
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:157) [gax-1.42.0.jar!/:1.42.0] .......... at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
Suppressed: java.lang.UnsatisfiedLinkError: /tmp/libio_grpc_netty_shaded_netty_tcnative_linux_x86_649219715802563293305.so: Error loading shared library libcrypt.so.1: No such file or directory (needed by /tmp/libio_grpc_netty_shaded_netty_tcnative_linux_x86_649219715802563293305.so)
at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[na:1.8.0_191]
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) ~[na:1.8.0_191]
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) ~[na:1.8.0_191]
at java.lang.Runtime.load0(Runtime.java:809) ~[na:1.8.0_191]
at java.lang.System.load(System.java:1086) ~[na:1.8.0_191]
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:36) ~[grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:316) ~[grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:215) ~[grpc-netty-shaded-1.18.0.jar!/:1.18.0]
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:96) ~[grpc-netty-shaded-1.18.0.jar!/:1.18.0]
... 84 common frames omitted
Suppressed: java.lang.UnsatisfiedLinkError: /tmp/libio_grpc_netty_shaded_netty_tcnative_linux_x86_649219715802563293305.so: Error loading shared library libcrypt.so.1: No such file or directory (needed by /tmp/libio_grpc_netty_shaded_netty_tcnative_linux_x86_649219715802563293305.so)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:36)
2019-03-22 14:03:34.758 INFO [conversationservice,ecfde081e153174a22ba98fbf11a4c99,22ba98fbf11a4c99,true] 1 --- [nio-9414-exec-1] i.g.n.s.io.grpc.netty.GrpcSslContexts
: Conscrypt not found (this may be normal)
2019-03-22 14:03:34.759 INFO [conversationservice,ecfde081e153174a22ba98fbf11a4c99,22ba98fbf11a4c99,true] 1 --- [nio-9414-exec-1] i.g.n.s.io.grpc.netty.GrpcSslContexts
: Jetty ALPN unavailable (this may be normal)
java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN
请帮助我解决此问题