The APR based Apache Tomcat Native library which allows ...java.library...异常
tomat在linux服务器上启动报TheAPRbasedApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:/usr/local/jdk1.6.0_26/jre/lib/i386/server:/usr/local/jdk1.6.0_26/jre/lib/i386:/usr/local/jdk1.6.0_26/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
异常解决方法:
apr与tomcat-native提供更好的伸缩性、性能和集成到本地服务器技术。
如果没有apr技术,启动tomcat时出现如下提示:
信息:TheAPRbasedApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:/usr/java/jdk1.6.0_06/jre/lib/i386/client:/usr/java/jdk1.6.0_06/jre/lib/i386:/usr/java/jdk1.6.0_06/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
按照官方说明需要:
APRlibrary
OpenSSLlibraries
openssl可以用yuminstallopenssl-devel,apr还是下载*.gz来安装。
apr-1.3.2.tar.gz(下载URL:http://www.apache.org/dist/apr/apr-1.4.5.tar.gz)
apr-util-1.3.2.tar.gz(下载URL:http://www.apache.org/dist/apr/apr-util-1.3.12.tar.gz)
tomcat-native.tar.gz可以在tomcat/bin目录下找到。
安装apr
wgethttp://apache.mirror.phpchina.com/apr/apr-1.3.2.tar.gz
tarzxvfapr-1.3.2.tar.gz
cdapr-1.3.2
./configure
make
makeinstall
apr默认安装在/usr/local/apr
安装apr-util
wgethttp://apache.mirror.phpchina.com/apr/apr-util-1.3.2.tar.gz
tarzxvfapr-util-1.3.2.tar.gz
cdapr-util-1.3.2
./configure--with-apr=/usr/local/apr
make
makeinstall
安装tomcat-native
cd/usr/local/tomcat-6.0.18/bin
tarzxvftomcat-native.tar.gz
cdtomcat-native-1.1.14-src/jni/native
./configure--with-apr=/usr/local/apr--with-java-home=/usr/java/jdk1.6.0_11
make
makeinstall
设置apr的环境变量:
vi/etc/profile
#后面添加以下内容
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
#使profile生效,
source/etc/profile
启动tomcat后,看日志:
bin/startup.sh
headlogs/catalina.out
可以看到以下结果:
信息:LoadedAPRbasedApacheTomcatNativelibrary1.1.14.
2009-1-1311:12:51org.apache.catalina.core.AprLifecycleListenerinit
信息:APRcapabilities:IPv6[true],sendfile[true],acceptfilters[false],random[true].