I have deployed a web-application inside a tomcat container and have used grpc-netty (1.2.0) with netty-tcnative-boringssl-static:jar:1.1.33.Fork26.
When i switch on debug logs it tells that "java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty-tcnative-linux-x86_64, netty-tcnative-linux-x86_64-fedora, netty-tcnative]" and then a error message "java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.".
I have gone through the troubleshooting section of https://github.com/grpc/grpc-java/blob/master/SECURITY.md and have verified my netty versions and this looks to be fine. Below is my maven dependency list
[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
Debug logs:
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.<clinit>(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.<clinit>(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.<clinit>(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)