Hi,

Am 08.10.2016 um 05:08 schrieb Huxing Zhang:
...

     [echo] tc.library.path = 
/home/admin/tomcat/tcnative/tomcat-native-1.2.10-src/native/.libs

     [echo] Running Tomcat Native Echo example ...
     [java] Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/home/admin/tomcat/tcnative/tomcat-native-1.2.10-src/native/.libs/libtcnative-1.so.0.2.10:
 
/home/admin/tomcat/tcnative/tomcat-native-1.2.10-src/native/.libs/libtcnative-1.so.0.2.10:
 undefined symbol: get_rfc3526_prime_8192
     [java]     at java.lang.ClassLoader$NativeLibrary.load(Native Method)
     [java]     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
     [java]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
     [java]     at java.lang.Runtime.loadLibrary0(Runtime.java:870)
     [java]     at java.lang.System.loadLibrary(System.java:1122)
     [java]     at org.apache.tomcat.jni.Library.<init>(Unknown Source)
     [java]     at org.apache.tomcat.jni.Library.initialize(Unknown Source)
     [java]     at org.apache.tomcat.jni.Echo.main(Unknown Source)
     [java] Java Result: 1

The symbol get_rfc3526_prime_8192 is part of OpenSSL even in 0.9.8. Let's try to find out, why it can't be found.

Assuming Linux for the following.

First look at your library file /home/admin/tomcat/tcnative/tomcat-native-1.2.10-src/native/.libs/libtcnative-1.so.0.2.10. Check whether is has an external dependency on libcrypto, what is the RUNPATH and/or whether the symbols are statically compiled in:

- What is the output of "objdump -p /home/admin/tomcat/tcnative/tomcat-native-1.2.10-src/native/.libs/libtcnative-1.so.0.2.10"?

- What is the output of "nm /home/admin/tomcat/tcnative/tomcat-native-1.2.10-src/native/.libs/libtcnative-1.so.0.2.10 | grep get_rfc3526_prime_8192"?

Next: assuming you linked against the dynamic libcrypto library, where is your libcrypto.so.1.0.0 for OpenSSL 1.0.2 located? Is it inside /home/admin/tomcat/tcnative/tomcat-native-1.2.10-src/native/.libs (unlikely) or somewhere else? How is Java expected to find it there? Did you add the directory to LD_LIBRARY_PATH?

Finally check the libcrypto.so.1.0.0 from OpenSSL 1.0.2 whether it contains the symbol: what's the output of "nm /path/to/my/libcrypto.so.1.0.0 | grep get_rfc3526_prime_8192"?

Regards,

Rainer




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to