![tomcat 8.5.5 tcnative 未定义符号 BN_get_rfc3526_prime_8192](https://linux22.com/image/693974/tomcat%208.5.5%20tcnative%20%E6%9C%AA%E5%AE%9A%E4%B9%89%E7%AC%A6%E5%8F%B7%20BN_get_rfc3526_prime_8192.png)
我在 CentOS 6.7 上安装了 Tomcat 8.5.5、APR、APR-Util、OpenSSL 1.1.0 和 TCNative,启动 tomcat 时 catalina.out 中出现以下警告
我已经从 $CATALINA_HOME/bin 文件夹安装了 tcnative,并且还尝试从 apache 的网站安装 tcnative。
WARNING [main] org.apache.catalina.core.AprLifecycleListener.init The APR based Apache Tomcat Native library failed to load. The error reported was [/usr/local/apr/lib/libtcnative-1.so.0.2.10: /usr/local/apr/lib/libtcnative-1.so.0.2.10: undefined symbol: BN_get_rfc3526_prime_8192]
java.lang.UnsatisfiedLinkError: /usr/local/apr/lib/libtcnative-1.so.0.2.10: /usr/local/apr/lib/libtcnative-1.so.0.2.10: undefined symbol: BN_get_rfc3526_prime_8192
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.apache.tomcat.jni.Library.<init>(Library.java:42)
at org.apache.tomcat.jni.Library.initialize(Library.java:178)
at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:198)
at org.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:107)
at org.apache.catalina.connector.Connector.setProtocol(Connector.java:565)
at org.apache.catalina.connector.Connector.<init>(Connector.java:70)
at org.apache.catalina.startup.ConnectorCreateRule.begin(ConnectorCreateRule.java:64)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1190)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1458)
at org.apache.catalina.startup.Catalina.load(Catalina.java:578)
at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
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 org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
有什么建议么?
马克,ldd /usr/local/apr/lib/libtcnative-1.so.0.2.10 的输出如下:
linux-vdso.so.1 => (0x00007ffd137fa000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007f6efdf31000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f6efdb48000)
libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0x00007f6efd915000)
librt.so.1 => /lib64/librt.so.1 (0x00007f6efd70d000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f6efd4d5000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6efd2b9000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f6efd0b5000)
libc.so.6 => /lib64/libc.so.6 (0x00007f6efccf2000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f6efcaa6000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f6efc7c1000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f6efc5bc000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f6efc38a000)
libz.so.1 => /lib64/libz.so.1 (0x00007f6efc174000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6efe3d0000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007f6efbf70000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f6efbd61000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f6efbb5d000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f6efb942000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f6efb71d000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f6efb4bb000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f6efb296000)
答案1
库libtcnative-1.so.0.2.10
已与 链接libssl.so.10
,通常是 OpenSSL 1.0.x。您需要重新制作它,以与 OpenSSL 1.1.0 链接(因此 ldd 将显示类似 的内容libssl.so.1.1
)。