首页 > 代码库 > 出现错误日志:The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

出现错误日志:The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

tomcat6出现错误日志:
信息: 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
 技术分享

 

解决:
通过安装和配置apr解决。
Tomcat Native 可以让 Tomcat 使用 Apache 的 apr 包来处理包括文件和网络IO操作,以提升性能。
 
1.安装:yum -y install openssl-devel
 
2.下载:apr-1.4.6.tar.gz、apr-util-1.4.1.tar.bz2、tomcat-native-1.1.19-src.tar.gz
(下载地址:http://archive.apache.org/dist/tomcat/tomcat-connectors/native/) 
 
3.安装apr:
tar -xzf apr-1.4.6.tar.gz 
cd apr-1.4.6
./configure && make && make install
 
tar -xjf apr-util-1.4.1.tar.bz2
cd apr-util-1.4.1

./configure --with-apr=/usr/local/apr   && make  && make install 

 
tar -xzf tomcat-native-1.1.19-src.tar.gz
cd /opt/tomcat-native-1.1.19-src/jni

./configure --with-apr=/usr/local/apr --with-java-home=/opt/jdk && make && make install

 
4.设置apr的环境变量:
vi /etc/profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
保存退出
source /etc/profile
 
再查看catalina.out日志,发现不再报错了:
技术分享

信息: An older version 1.1.19 of the APR based Apache Tomcat Native library is installed, while Tomcat recommends a minimum version of 1.1.22

出现错误日志:The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path