java no suggestions available_无法加载任何给定的库:[netty-tcnative-linux-x86_64,netty-tcnative]...

在Tomcat容器中部署的Web应用程序遇到问题,使用了grpc-netty(1.2.0)和netty-tcnative-boringssl-static:jar:1.1.33.Fork26。启动时,日志显示'java.lang.IllegalArgumentException:无法加载任何给定的库:[netty-tcnative-linux-x86_64,netty-tcnative-linux-x86_64-fedora,netty-tcnative]'。已检查过netty版本,但问题依然存在。调试日志显示无法找到netty-tcnative-linux-x86_64库,导致OpenSslEngine不可用。建议参考http://netty.io/wiki/forked-tomcat-native.html进行故障排查。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我已经在tomcat容器中部署了一个Web应用程序,并已将grpc-netty(1.2.0)与netty-tcnative-boringssl-

static:jar:1.1.33.Fork26一起使用。

当我打开调试日志时,它会告知“ java.lang.IllegalArgumentException:无法加载任何给定的库:[netty-tcnative-

linux-x86_64,netty-tcnative-linux-x86_64-fedora,netty-tcnative]”和然后错误消息“

java.lang.IllegalArgumentException:码头ALPN / NPN尚未正确配置。”。

我浏览了https://github.com/grpc/grpc-

java/blob/master/SECURITY.md的疑难解答部分,并验证了我的netty版本,这看起来还不错。下面是我的Maven依赖列表

[INFO] | +- io.grpc:grpc-core:jar:1.2.0:compile

[INFO] | | +- com.google.guava:guava:jar:19.0:compile

[INFO] | | +- com.google.errorprone:error_prone_annotations:jar:2.0.11:compile

[INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.0:compile

[INFO] | | +- io.grpc:grpc-context:jar:1.2.0:compile

[INFO] | | \- com.google.instrumentation:instrumentation-api:jar:0.3.0:compile

[INFO] | +- io.grpc:grpc-netty:jar:1.2.0:compile

[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.8.Final:compile (version selected from constraint [4.1.8.Final,4.1.8.Final])

[INFO] | | | +- io.netty:netty-codec-http:jar:4.1.8.Final:compile

[INFO] | | | | \- io.netty:netty-codec:jar:4.1.8.Final:compile

[INFO] | | | \- io.netty:netty-handler:jar:4.1.8.Final:compile

[INFO] | | | \- io.netty:netty-buffer:jar:4.1.8.Final:compile

[INFO] | | | \- io.netty:netty-common:jar:4.1.8.Final:compile

[INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.8.Final:compile

[INFO] | | +- io.netty:netty-transport:jar:4.1.8.Final:compile

[INFO] | | | \- io.netty:netty-resolver:jar:4.1.8.Final:compile

[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.8.Final:compile

[INFO] | +- io.grpc:grpc-protobuf:jar:1.2.0:compile

[INFO] | | +- com.google.protobuf:protobuf-java:jar:3.2.0:compile

[INFO] | | +- com.google.protobuf:protobuf-java-util:jar:3.2.0:compile

[INFO] | | | \- com.google.code.gson:gson:jar:2.7:compile

[INFO] | | \- io.grpc:grpc-protobuf-lite:jar:1.2.0:compile

[INFO] | +- io.grpc:grpc-stub:jar:1.2.0:compile

[INFO] | +- net.javacrumbs.future-converter:future-converter-java8-guava:jar:1.1.0:compile

[INFO] | | +- net.javacrumbs.future-converter:future-converter-common:jar:1.1.0:compile

[INFO] | | +- net.javacrumbs.future-converter:future-converter-java8-common:jar:1.1.0:compile

[INFO] | | \- net.javacrumbs.future-converter:future-converter-guava-common:jar:1.1.0:compile

[INFO] | +- io.netty:netty-tcnative-boringssl-static:jar:1.1.33.Fork26:compile

调试日志:

2018-04-23 11:38:28 DEBUG NativeLibraryLoader:71 - -Dio.netty.tmpdir: /opt/tomcat/temp (java.io.tmpdir)

2018-04-23 11:38:28 DEBUG NativeLibraryLoader:71 - -Dio.netty.native.workdir: /opt/tomcat/temp (io.netty.tmpdir)

2018-04-23 11:38:28 DEBUG NativeLibraryLoader:81 - Unable to load the library 'netty-tcnative-linux-x86_64', trying other loading mechanism.

java.lang.UnsatisfiedLinkError: no netty-tcnative-linux-x86_64 in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)

at java.lang.Runtime.loadLibrary0(Runtime.java:870)

at java.lang.System.loadLibrary(System.java:1122)

at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)

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 io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:273)

at java.security.AccessController.doPrivileged(Native Method)

at io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:264)

at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:252)

at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:199)

at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:170)

at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:412)

at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:90)

at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:158)

at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:139)

at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:109)

2018-04-23 11:38:28 DEBUG NativeLibraryLoader:81 - Unable to load the library 'netty-tcnative-linux-x86_64', trying next name...

java.lang.UnsatisfiedLinkError: no netty-tcnative-linux-x86_64 in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)

at java.lang.Runtime.loadLibrary0(Runtime.java:870)

at java.lang.System.loadLibrary(System.java:1122)

at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)

at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:259)

at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:199)

at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:170)

at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:412)

at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:90)

at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:158)

at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:139)

at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:109

2018-04-23 11:38:28 DEBUG OpenSsl:91 - Failed to load netty-tcnative; OpenSslEngine will be unavailable, unless the application has already loaded the symbols by some other means. See http://netty.io/wiki/forked-tomcat-native.html for more information.

java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty-tcnative-linux-x86_64, netty-tcnative-linux-x86_64-fedora, netty-tcnative]

at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:177)

at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:412)

at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:90)

at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:158)

at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:139)

at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:109)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值