没有找到基于APR的Apache Tomcat Native库...(但我有)

时间:2015-04-13 18:52:24

标签: tomcat apr kony lifecycleexception

我正在运行某些软件并因未找到apr而收到以下错误消息。我看到它不存在,所以转到apr文件夹,运行./configure./make以及./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

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

2 个答案:

答案 0 :(得分:4)

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

apt-get install libtcnative-1 

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

答案 1 :(得分:0)

在Oracle Linux 7上,一种RHEL7的克隆,我必须编译lib并在/usr/lib64 ...中复制它们

请参阅http://tomcat.apache.org/native-doc/

基本上:

  1. 安装deps:
  2.     yum install apr-devel openssl-devel
    
    1. http://tomcat.apache.org/native-doc/
    2. 下载并解压缩最新文件
    3. CD到解压缩文件的位置
    4.     ./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 
      

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