Skip to content

java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.Library.version(I)I #136

Closed
@shelined

Description

@shelined

I'm attempting to use grpc-java with netty-tcnative-boringssl-static and getting the following exception.

DEBUG io.netty.handler.ssl.OpenSsl - Failed to load netty-tcnative; OpenSslEngine will be unavailable. See http://netty.io/wiki/forked-tomcat-native.html for more information.
java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.Library.version(I)I
    at org.apache.tomcat.jni.Library.version(Native Method) ~[netty-tcnative-boringssl-static-1.1.33.Fork14-linux-x86_64.jar:1.1.33.Fork14]
    at org.apache.tomcat.jni.Library.initialize(Library.java:176) ~[netty-tcnative-boringssl-static-1.1.33.Fork14-linux-x86_64.jar:1.1.33.Fork14]
    at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:61) ~[netty-handler-4.1.0.CR3.jar:4.1.0.CR3]
    at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:135) [grpc-netty-0.13.2.jar:0.13.2]
    at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:117) [grpc-netty-0.13.2.jar:0.13.2]
    at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:88) [grpc-netty-0.13.2.jar:0.13.2]

I understand it might complicate things but I'm running inside Tomcat for the time being. I have set the -classpath to the path of netty-tcnative-boringssl-static-1.1.33.Fork14-linux-x86_64.jar as you can see below in the command to execute Tomcat.

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djuli-logback.configurationFile=file:/usr/local/tomcat/conf/logback.xml? -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/webapps/ROOT/WEB-INF/lib/netty-tcnative-boringssl-static-1.1.33.Fork14-linux-x86_64.jar:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start

I've tried both statically and dynamically linked and keep running across the same exception.

grpc-java = 0.13.2
netty-tcnative-boringssl-static = 1.1.33.Fork14 on linux-x86_64 (also tried dynamic and Fork15)

$ java -version
openjdk version "1.8.0_72-internal"
OpenJDK Runtime Environment (build 1.8.0_72-internal-b15)
OpenJDK 64-Bit Server VM (build 25.72-b15, mixed mode)
$ uname -a     
Linux <docker container name> 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 GNU/Linux

CCing @nmittler and @normanmaurer per @nmittler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions