Tomcat启动报错java.lang.Exception: APR not available

Aug 09, 2012 12:06:23 AM 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: /usr/java/packages/lib/i386:/lib:/usr/lib
Aug 09, 2012 12:06:24 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-7011"]
Aug 09, 2012 12:06:24 AM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-apr-7011"]
java.lang.Exception: APR not available
        at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:389)
        at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:566)
        at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:417)
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        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:814)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
        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:601)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)
 
Aug 09, 2012 12:06:24 AM org.apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-7011]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-7011]]
        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:814)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
        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:601)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:958)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        ... 12 more
Caused by: java.lang.Exception: APR not available
        at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:389)
        at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:566)
        at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:417)
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
        ... 13 more

解决办法在tomcat/bin/catalina.sh中增加-Djava.library.path参数

CATALINA_OPTS='-server -Xms1024m -Xmx1024m -XX:NewRatio=3 -XX:PermSize=128m -XX:MaxPermSize=256m -Duser.country=US -Duser.language=en -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dcom.sun.management.jmxremote=true -Djava.library.path=/usr/local/apr/lib:/usr/java/packages/lib/i386:/lib:/usr/lib'

原创文章,转载请注明: 转载自海波无痕

本文链接地址: Tomcat启动报错java.lang.Exception: APR not available

文章的脚注信息由WordPress的wp-posturl插件自动生成

此条目发表在server分类目录,贴了, , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论链接可以 移除 nofollow.