# tomcat 启动异常 :
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent 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/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
https://apr.apache.org/
image.png
image.png
# 拷贝到服务器
scp -r apr-1.7.0 root@*.*.*.28:/usr/local
cd /usr/local/apr-1.7.0
./configure && make && make install
cd /usr/local/tomcat/bin/
tar -zxvf tomcat-native.tar.gz
cd /usr/local/tomcat/bin/tomcat-native-1.2.23-src/native/
# 注意下面的/usr/local/apr 而不是/usr/local/apr-1.7.0
./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
make && make install
vim /etc/profile
# 在最后增加
# 注意下面的/usr/local/apr 而不是/usr/local/apr-1.7.0
export LD_LIBRARY_PATH=/usr/local/apr/lib
source /etc/profile
# 完毕
遇到问题:
# 重启tomcat之后还是异常:
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/local/apr-1.7.0/lib:/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
问题原因:
这个错误是由于我将/usr/local/apr 写成了/usr/local/apr-1.7.0
网友评论