APR not available

Tomcat三种请求处理方式:BIO、NIO、APR 

APR为从从做系统级别解决异步IO问题,大幅度提高服务器的处理和响应速度

最近在升级启动程序时,出现如下错误

[ERROR] main 08:55:17 LifecycleBase:175(log) Failed to initialize component [Connector[org.apache.coyote.http11.Http11AprProtocol-8080]]
....
[INFO] main 08:55:17 AprLifecycleListener:173(log) The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
......
org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
Caused by: java.lang.Exception: APR not available
        at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:295)
        at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1067)
        at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1149)
        at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:561)
        at org.apache.catalina.connector.Connector.startInternal(Connector.java:998)
        ... 20 common frames omitted

 

可能原因:

1、APR未安装或者安装不正确

2、APR安装,但环境变量未生效

解决方法:

1、APR未安装或者安装不正确,则可以再次尝试安装APR

2、环境变量未生效,则可以查看下/etc/profile下是否已经export APR的地址,比如:export LD_LIBRARY_PATH=/usr/aprlib/lib,如果不存在,则添加(地址根据时机情况配置),如果存在该配置还不生效,则可以在程序的启动脚本中,在启动之前添加该export

上一篇:LAMP


下一篇:JedisPoolUtil工具包