java.lang.UnsatisfiedLinkError: no netty_tcnative_osx_x86_64 in java.library.path
why cant load
java.lang.UnsatisfiedLinkError: no netty_tcnative_osx_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:336)
at java.security.AccessController.doPrivileged(Native Method)
at io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:328)
at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:306)
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:136)
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:96)
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:440)
at io.netty.handler.ssl.OpenSsl.
I am also facing the same issue - https://github.com/grpc/grpc-java/issues/6735
@raviprakashmishra i solved,unzip grpc-netty-shaded jar,in METS_INF/native have 3 native file,then use -Djava.library.path config this 3 native file load,its ok
Right, I fixed the issue same way but I think if the environment variable is not defined then logging the message with the stack trace is bit too much even at the debug level. I don't want to maintain extra set of native dlls in my environment for any possible compatibility problems.
As you are using grpc-netty-shaded, you should use BoringSSL instead of OpenSSL otherwise you might need to shade OpenSSL as well which probably will not work.
what does it mean to shade the OpenSSL? Is there any documentation on using BoringSSL vs OpenSSL with grpc-netty-shaded?
See BoringSSL for using BoringSSL. For shading you need to use "maven shade plugin" which is quite complicated if you did not know it. I don't think shading will work because tcnative contains JNI.
@metayx, you should not unzip grpc-netty-shaded. Instead you should add a dependency on netty-tcnative-boringssl-static.