解决:The APR based Apache Tomcat Native library which allows optimal performance in production...
tomcat日志apr报错引发的基于Tomcat Native加速Tomcat性能
tomact服务启动报错日志如下:
息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/ss/jdk1.6.0_13/jre/lib/amd64/server:/home/ss/jdk1.6.0_13/jre/lib/amd64:/home/ss/jdk1.6.0_13/jre/../lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2013-6-8 10:19:00 org.apache.coyote.http11.Http11Protocol init
缺少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).
网上搜索解释:
tomcat native在具体的运行平台上,提供了一种优化技术,它本身是基于APR(Apache Portable Runtime)技术
也就是说,我们应用了tomcat native技术之后,tomcat在跟操作系统级别的交互方面可以做得更好,并且它更像apache一个,可以更好地作为一台web server。
目前,Tomcat Native的最新版本是1.1.27 如果tomcat包里没有自带native的话
其下载地址:http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.24/source/tomcat-native-1.1.24-src.tar.gz
测试时发现我的tomcat1.5版本不支持tomcat-nativer的1.1.27最新版本,1.1.24版可以使用.
1. 安装方法参见:http://tomcat.apache.org/native-doc/
#yum install apr-devel
#cd ~/apache-tomcat-6.0.36/bin
#tar zxf tomcat-native.tar.gz
#cd ~/apache-tomcat-6.0.36/bin/tomcat-native-1.1.23-src/jni/native
#./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/home/ss/jdk1.6.0_13 --prefi
x=/home/ss/apache-tomcat-6.0.36
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'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
2. 添加环境变量:
官网说明:Edit $CATALINA_HOME/bin/setenv.sh (creating the file if necessary) and add the path to the tc-native libraries to LD_LIBRARY_PATH
tomcat安装目录bin下创建setenv.sh文件:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
export LD_LIBRARY_PATH
3. 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].
如果还是报错路径下找不到库:
息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/saas/jdk1.6.0_13/jre/lib/amd64/server:/home/saas/jdk1.6.0_13/jre/lib/amd64:/home/saas/jdk1.6.0_13/jre/../lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
解决,将安装好的libtcnative库拷贝到上面提示的任一地址下即可:
# ll ~/jdk1.6.0_13/jre/lib/amd64/server/
-rw-r--r-- 1 saas saas 1604882 6月 18 16:43 libtcnative-1.a
-rwxr-xr-x 1 saas saas 1042 6月 18 16:43 libtcnative-1.la
-rwxr-xr-x 1 saas saas 902937 6月 18 16:42 libtcnative-1.so
-rwxr-xr-x 1 saas saas 902937 6月 18 16:43 libtcnative-1.so.0
-rwxr-xr-x 1 saas saas 902937 6月 18 16:43 libtcnative-1.so.0.1.24
原文:http://blog.51cto.com/iceeggplant/1218909
解决:The APR based Apache Tomcat Native library which allows optimal performance in production...的更多相关文章
- 【问题解决:信息提示】SpringBoot启动时提示The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
问题描述 springboot程序在启动时提示信息 [2018-10-24 21:59:05.214] - 440 信息 [restartedMain] --- org.apache.catalina ...
- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
运行环境: Intellij idea 14 在改了项目名称. 运行时候出现了 The APR based Apache Tomcat Native library which allows opti ...
- IDEA搭建ssm框架测试衍生出的问题The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Develop\jdk7\jdk1.7.0_79\bin;
最近玩起IDEA这开发工具,搭建ssm框架测试时,部署项目出现如下问题: 信息: The APR based Apache Tomcat Native library which allows opt ...
- 信息: 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 productio ...
- Tomcat启动慢原因之二 he APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
Tomcat启动时提示: 信息: The APR based Apache Tomcat Native library which allows optimal performance in prod ...
- 出现错误日志: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 ...
- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_60\bin;C:\Windows\Sun\Jav
启动项目自动结束,查看日志发现 [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache To ...
- Tomcat 报错 The APR based Apache Tomcat Native library which allows optimal performance in production environmen
这个问题在我一次重新装了tomcat和myeclipse时出现 说实话 出现这个问题头大 但是好在解决了 美滋滋 最开始到处寻找各种解决方案 最后直接注释了server.xml中的一行 直接解决这个报 ...
- tomcant报错The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
下载与你Tomcat对应版本的 tcnative-1.dll,放到apache-tomcat-7.0.57\bin 目录下,重启tomcat http://archive.apache.org/dis ...
随机推荐
- angularjs 出现 “Possibly unhandled rejection: cancel ”错误
Try adding this to your config. I had a similar is once and this workaround did the trick. app.confi ...
- python调用函数
1.同一包内的调用 直接使用import 文件名 或者from 文件名 import 函数名 a.py def p(): print("abc") b.py from a impo ...
- RouterOS DNS劫持(转)
什么是DNS劫持 DNS劫持就是通过技术手段,来控制用户解析域名的IP地址.举个例子,正常解析域名www.awolf.net时应该返回IP:64.64.30.60:但现在通过DNS劫持,使域名www. ...
- 复制新增树状数据_ParentID也需要更新
CREATE TABLE TreeShip( [ID] uniqueidentifier PRIMARY KEY NOT NULL, [Name] [nvarchar](50) NULL, [R ...
- Linux实战教学笔记30:Nginx反向代理与负载均衡应用实践
1.1 集群简介 简单地说,集群就是指一组(若干个)相互独立的计算机,利用高速通信网络组成的一个较大的计算机服务系统,每个集群节点(即集群中的每台计算机)都是运行各自服务的独立服务器.这些服务器之间可 ...
- FP回写报错
报错信息如下: 提示java for mo 2022报错 执行的DTS如下: 解决方法:(原因:SAP归档日志满了,导致连接失败)1.检查表temp_out_pr中的siteid是否有三个工厂的数据确 ...
- 【UVA1515 算法竞赛入门指南】 水塘【最小割】
题意: 输入一个h行w列的字符矩阵,草地用“#”表示,洞用"."表示.你可以把草改成洞,每格花费为d,也可以把洞填上草,每格花费为f.最后还需要在草和洞之间修围栏,每条边花费为b. ...
- spark属性
应用属性 属性名 缺省值 意义 spark.app.name (none) The name of your application. This will appear in the UI and i ...
- 存储过程中使用事务和try catch
一.存储过程中使用事务的简单语法 在存储过程中使用事务时非常重要的,使用数据可以保持数据的关联完整性,在Sql server存储过程中使用事务也很简单,用一个例子来说明它的语法格式: 代码 : Cre ...
- archives of source
"ubuntu 暂时不能解析域名 archive.ubuntu.com"怎么办? root下输入命令:lsb_release -a用来查询Ubuntu版本号 登录网站 http:/ ...