解决Linux下Tomcat由于Tomcat Native问题启动报错
来源:互联网 发布:linux自启动脚本配置 编辑:程序博客网 时间:2024/05/16 11:02
是由于缺少apr的支持:
Tomcat Native 是利用 APR 来提升Tomcat性能的本地API
Tomcat Native 这个项目可以让 Tomcat 使用 Apache 的 apr 包来处理包括文件和网络IO操作,以提升性能。
以下是tomcat官网说明:
Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies. The Apache Portable Runtime is a highly portable library that is at the heart of Apache HTTP Server 2.x. APR has many uses, including access to advanced IO functionality (such as sendfile, epoll and OpenSSL), OS level functionality (random number generation, system status, etc), and native process handling (shared memory, NT pipes and Unix sockets).
解决方案:
安装apr-devel
#yum install apr-devel
进入tomcat安装目录
#cd $CATALINA_HOME/bin
解压文件到当前目录
#tar zxf tomcat-native.tar.gz
进入native源码目录
#cd $CATALINA_HOME/bin/tomcat-native-1.1.27-src/jni/native
配置编译信息
#./configure --with-apr=/usr/bin/apr-1-config --with-java-home=$JAVA_HOME --prefix=$CATALINA_HOME
编译
make && make install
安装成功如下提示:
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apr/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
more information, such as the ld(1) and ld.so(8) manual pages.
添加配置:
tomcat安装目录bin下创建setenv.sh文件:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
export LD_LIBRARY_PATH
tomcat启动后查看日志 apr已加载上
2013-6-8 14:31:05 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.23 using APR version 1.3.9.
2013-6-8 14:31:05 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
如果还是报错则进入到.libs/libs目录(这里32位和64位有区别)
libtcnative-1.a
libtcnative-1.la -> ../libtcnative-1.la
libtcnative-1.lai
libtcnative-1.so -> libtcnative-1.so.0.1.27
libtcnative-1.so.0 -> libtcnative-1.so.0.1.27
libtcnative-1.so.0.1.27
里面有几个链接文件,把
libtcnative-1.a
libtcnative-1.lai
libtcnative-1.so.0.1.27
和libtcnative-1.la链接指向的文件(上一级目录的libtcnative-1.la)拷贝到$JAVA_HOME/jre/lib/amd64(i386-32位系统)/server下即可。
如果windows下报错是拷贝几个dll文件至windows/system32下,apache官网有。
- 解决Linux下Tomcat由于Tomcat Native问题启动报错
- linux下tomcat无法启动报错
- Linux下Tomcat 启动报错touch
- linux下tomcat启动报错
- 解决tomcat启动报错
- tomcat启动报错解决
- tomcat启动报错-问题
- Tomcat 启动报错问题
- linux启动tomcat报错
- tomcat启动报错,可能由于配置文件正在使用
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
- tomcat(错误一) 解决启动报错问题一
- tomcat(错误三) 解决启动报错问题三
- 解决 Linux下tomcat启动提示内存泄露问题
- 一个在linux下启动Tomcat报错的解决方案
- linux下启动tomcat报错:The BASEDIR environment...
- Linux下tomcat启动报错:port already in use
- Java 泛型的总结
- typedef使用详解
- mysql安装图解
- ubuntu source insight中文乱码
- NOIP2001普及组 最大公约数和最小公倍数问题
- 解决Linux下Tomcat由于Tomcat Native问题启动报错
- OCP-1Z0-053-V12.02-530题
- C++连接mysql数据库
- 欧拉回路算法
- Viojs P1096 津津的储蓄计划
- 黑马程序员-基础知识部分总结
- 自定义标签
- 确定二叉树结构
- 【Java Web】: HTTP协议详解