3

我正在运行一些软件并收到以下关于未找到 apr 的错误。我看到它不存在,所以去了 apr 文件夹,运行./configureand ./makeand ./make install

它在/usr/local/apr/lib.

然后我创建了 Tomcat 日志中提到的文件夹:

/root/Kony/KonyServer/tomcat/instance1/bin/tomcat-native-1.1.29-src/jni/native/.libs

并将文件复制到这里:

-rwxrwxrwx. 1 10848 10848    8351 Apr 13 19:35 apr.exp
-rwxrwxrwx. 1 10848 10848 1352604 Apr 13 19:35 libapr-1.a
-rwxrwxrwx. 1 10848 10848     826 Apr 13 19:35 libapr-1.la
-rwxrwxrwx. 1 10848 10848  736579 Apr 13 19:35 libapr-1.so
-rwxrwxrwx. 1 10848 10848  736579 Apr 13 19:35 libapr-1.so.0
-rwxrwxrwx. 1 10848 10848  736579 Apr 13 19:35 libapr-1.so.0.4.5

我什至给了他们一个 777 面具,并且所有者/组与父母相匹配。它仍然给我下面的错误。

Apr 13, 2015 7:46:42 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /root/Kony/KonyServer/tomcat/instance1/bin/tomcat-native-1.1.29-src/jni/native/.libs
Apr 13, 2015 7:46:43 PM org.apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8085]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8085]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
Caused by: org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:972)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    ... 12 more

Apr 13, 2015 7:46:43 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8010"]
Apr 13, 2015 7:46:43 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2752 ms
Apr 13, 2015 7:46:44 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 13, 2015 7:46:44 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat 7.0.x-dev
Apr 13, 2015 7:46:44 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /root/Kony/KonyServer/tomcat/instance1/conf/Catalina/localhost/admin.xml

任何人都可以提供任何帮助吗?

4

2 回答 2

5

我在 Debian 中工作时遇到了类似的问题,我使用以下方法修复了它:

apt-get install libtcnative-1 

并取消注释 server.xml 中的 APRLifecycleListener。

于 2015-05-29T13:04:23.970 回答
0

在 Oracle Linux 7(一种 RHEL7 的克隆)上,我必须编译这些库并将它们也复制到/usr/lib64 ...

参考http://tomcat.apache.org/native-doc/

基本上:

  1. 安装部门:
    yum install apr-devel openssl-devel
  1. 从http://tomcat.apache.org/native-doc/下载并解压最新文件
  2. CD 到您提取文件的位置
    ./configure --with-apr=$HOME/APR \
        --with-java-home=$JAVA_HOME \
        --with-ssl=$HOME/OPENSSL \
        --prefix=$CATALINA_HOME
    make && make install
    cp -v /usr/share/tomcat/lib/libtcnative-1.* /lib64/
    systemctl restart tomcat 

完毕!!我所要做的就是在 server.xml 的条目中添加证书

于 2017-09-07T14:55:45.743 回答