关于Apache Portable Runtime and Tomcat
关于Apache Portable Runtime and Tomcat
在从Tomcat 5.0.28转向5.5.X时,在启动时发现出现如下信息
[org.apache.catalina.core.AprLifecycleListener]-[INFO] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: (...你的系统环境PATH路径...)
在停止时发现出现如下信息
[org.apache.catalina.core.AprLifecycleListener]-[INFO] Failed shutdown of Apache Portable Runtime
于是,想消除这个问题,通过查阅 http://tomcat.apache.org/tomcat-5.5-doc/apr.html
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).
These features allows making Tomcat a general purpose webserver, will enable much better integration with other native web technologies, and overall make Java much more viable as a full fledged webserver platform rather than simply a backend focused technology.
发现 Tomcat 可以用 Apache Portable Runtime 来提供更强性能,提升Web静态页面的处理能力,不再需要专门的Web Server来处理静态页面了。
但是APR的支持需要安装三个本地组件
APR support requires three main native components to be installed:
1、APR library
2、JNI wrappers for APR used by Tomcat (libtcnative)
3、OpenSSL libraries
解决:Windows下的安装配置与使用
1、先去 http://tomcat.heanet.ie/native/ 下载编译好的 tcnative-1.dll 文件,也可以下载tomcat-native.zip自己进行编译
2、修改一下 catalina.bat,加上
set CATALINA_OPTS="-Djava.library.path=../../APR/lib"
因为我把这个DLL放在与Tomcat目录同级的APR/lib目录下,所以采用了相对路径。或者把dll加到你的系统变量PATH里之类的,最简单的方法应当就是把tcnative-1.dll文件放在Tomcat的bin目录下:)
这样设置后,启动可以看到信息如下:
[org.apache.coyote.http11.Http11AprProtocol]-[INFO] Initializing Coyote HTTP/1.1 on http-9091
在停止时发现出现如下信息
[org.apache.coyote.http11.Http11AprProtocol]-[INFO] Pausing Coyote HTTP/1.1 on http-9091
......
[org.apache.coyote.http11.Http11AprProtocol]-[INFO] Stopping Coyote HTTP/1.1 on http-9091
这样就配置成功了。性能方面目前没有做详细的测试。
======================================================================
相关的文档参见
http://tomcat.apache.org/tomcat-5.5-doc/apr.html
相关的性能测试结果参见
http://www.javaworld.com.tw/jute/post/view?bid=9&id=139958&sty=3&age=0
评论
一、我从%tomcat%\bin中启动startup。bat时,弹出窗口:
应用程序或DLL:F:\tomcat\bin\tcnative-1.dll为无效的Windows映像。请再检测一遍你的安装盘。连续点了5次”确定“后,出现的提示是和你的类似
2008-4-16 12:44:25 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in produ
ction environments was not found on the java.library.path: (我的系统环境变量)。。。。
但是服务器还算是能启动了!
我新建了一个简单的jsp测试页面,以管理员的身份进点进去还是能正常显示的!但这样终究不是办法,觉得不舒服,因为在MyEclipse中启动Tomcat就很严重了!!!
二、从MyEclipse5.5.1GA中启动Tomcat
点了start后,打开了一个Integer.class页面,里面说“Source not found”
我一路点了Resume,Console下出现如下提示:
2008-4-16 12:52:33 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\Appsoftware\jdk1.5.0\bin;F:\tomcat\bin
2008-4-16 12:52:35 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-80
2008-4-16 12:52:35 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 11316 ms
2008-4-16 12:52:35 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2008-4-16 12:52:35 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.14
2008-4-16 12:52:37 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2008-4-16 12:52:37 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2008-4-16 12:52:40 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-80
2008-4-16 12:52:40 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2008-4-16 12:52:40 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47 config=null
2008-4-16 12:52:40 org.apache.catalina.startup.Catalina start
信息: Server startup in 4719 ms
提示的意思和前面的差不多,也弹出了那个提示窗口!
不知道这遇到的是什么情形的错误?
发表评论
我的相册
共 173 张
最近加入圈子
链接
- 超越黎明
- CJSDN
- CSDN
- JavaWorld@TW
- JavaEye
- Spring中文论坛
- Matrix
- BEA dev2dev
- Agile Tao Forum
- Flickr
- developerWorks
- TheServerSide
- Sun Java Forum
- JavaRanch
- 满江红开源
- del.icio.us
- Sun中国技术社区
- 希赛网中国软考
- AJAX Design Patterns
- CSS: The Missing Manual
- Java Persistence with Hibernate
- Script in Java
- Building Spring 2 Enterprise Applications
- Tuscany中文社区
- 我爱人开的购物店,欢迎光临
- Beginning Spring 2: From Novice to Professional
- Effective Java Second Edition
- JAVA世纪网
最新评论
-
请删除你的NPP吧,可以用 ...
引用引用 NotePad ++ 的作者没有什么可以非议的,人家只是公开表达了自己 ...
-- by JJiaoWzk -
2008年JavaEyer广州周末篮 ...
有没有活动照片可以秀啊
-- by fins -
2008年JavaEyer广州周末篮 ...
有没打成? 太可惜了,我国庆昏睡四天,再打了两天球,一天K歌.
-- by yidwo -
JSP文件下载及getOutputS ...
你的代码有问题,还是会抛出错误。解决办法:在使用完输出流以后调用以下两行代码即可 ...
-- by CoderDream -
多普达Dopod德版D900刷机 ...
我买多普达后,在坛子上泡了三天就开刷前一个星期刷了N次(N>=15),然后就烦了 ...
-- by Eastsun







评论排行榜