eclispe 启动 apache-tomcat-7.0.14 APR 出错解决办法


错误日志:

The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:


tomcat 官网 关于APR 介绍



找到对应平台安装办法:

Linux

Linux

Most Linux distributions will ship packages for APR and OpenSSL. The JNI wrapper (libtcnative) will then have to be compiled. It depends on APR, OpenSSL, and the Java headers.

Requirements:

  • APR 1.2+ development headers (libapr1-dev package)
  • OpenSSL 0.9.7+ development headers (libssl-dev package)
  • JNI headers from Java compatible JDK 1.4+
  • GNU development environment (gcc, make)

The wrapper library sources are located in the Tomcat binary bundle, in the bin/tomcat-native.tar.gz archive. Once the build environment is installed and the source archive is extracted, the wrapper library can be compiled using (from the folder containing the configure script):

./configure && make && make install


首先按要求 安装 APR OpenSSL 等等


然后 进入

~/web/apache-tomcat-7.0.14/bin$

解压  tomcat-native.tar.gz


再进入 ~/web/apache-tomcat-7.0.14/bin/tomcat-native-1.1.20-src/jni/native$ 


执行 官网提示的

./configure && make && make install

但一般不会成功,提示需要 添加参数 

--with-apr


按提示:

--with-apr=/usr/bin/apr-1-config  
--with-java-home=/usr/lib/jvm/java-6-sun-1.6.0.26
--with-ssl=yes 
--prefix=/home/dengpei/web/apache-tomcat-7.0.14

以上配置可以 查看 ~/.bashrc 文件


最终会在lib 目录生成 libtcnative 相关文件

dengpei@dengpei-pc:~/web/apache-tomcat-7.0.14/lib$ ls
annotations-api.jar  jsp-api.jar                          tomcat-api.jar
catalina-ant.jar     libtcnative-1.a                      tomcat-coyote.jar
catalina-ha.jar      libtcnative-1.la                     tomcat-dbcp.jar
catalina.jar         libtcnative-1.so                     tomcat-i18n-es.jar
catalina-tribes.jar  libtcnative-1.so.0                   tomcat-i18n-fr.jar
ecj-3.6.2.jar        libtcnative-1.so.0.1.20              tomcat-i18n-ja.jar
el-api.jar           mysql-connector-java-5.1.18-bin.jar  tomcat-util.jar
jasper-el.jar        pkgconfig
jasper.jar           servlet-api.jar
dengpei@dengpei-pc:~/web/apache-tomcat-7.0.14/lib$


ls -l  :

-rw-r--r-- 1 dengpei dengpei 1563680 2011-11-30 15:48 libtcnative-1.a
-rwxr-xr-x 1 dengpei dengpei    1071 2011-11-30 15:48 libtcnative-1.la
lrwxrwxrwx 1 dengpei dengpei      23 2011-11-30 15:48 libtcnative-1.so -> libtcnative-1.so.0.1.20
lrwxrwxrwx 1 dengpei dengpei      23 2011-11-30 15:48 libtcnative-1.so.0 -> libtcnative-1.so.0.1.20
-rwxr-xr-x 1 dengpei dengpei  880487 2011-11-30 15:48 libtcnative-1.so.0.1.20


最后将这些文件 拷贝到  /usr/lib/

cp libtcnative-1* /usr/lib/

运行 正常。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值