在从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目录下:),或者直接这里C:\WINDOWS\system32
这样设置后,启动可以看到信息如下:
[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 启动报APR based Apache Tomcat Native library not found" 指出的问题是关于Apache Tomcat服务器在启动时找不到基于APR(Apache Portable Runtime)的本机库。这通常涉及到Tomcat使用APR库来提高性能...
标题中提到的"APR based Apache Tomcat Native library 1.1.14"是这个库的一个特定版本,1.1.14是它的版本号。这个版本可能包含了对之前版本的改进、bug修复以及可能的新功能,旨在优化Tomcat在不同操作系统上的表现...
标题中的"The APR based Apache Tomcat Native library"是指Apache Portable Runtime(APR)库的一个组件,即Apache Tomcat Native库。这个库是专门为Apache Tomcat设计的,目的是为了提高其在处理网络I/O、系统调用...
如果看到类似`Using APR based Apache Tomcat Native library`的信息,说明APR已经启用。 通过以上步骤,你可以在Linux环境下成功地为Tomcat配置并启用APR,从而提升其性能。请确保按照每一步的指示操作,并根据你...
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path CProgram FilesJavajdk1.6.0_04jrebin;CProgram FilesTomcat ...
7. **验证配置**:启动Tomcat服务器,如果一切正常,你应该能在Tomcat的日志中看到类似“Using APR based Apache Tomcat Native library [version]”的提示,这表明APR已经成功启用。 通过上述步骤,你已经成功配置...
在Tomcat日志中,会有类似“Using APR based Apache Tomcat Native library”这样的信息。 通过启用Apr和Tomcat Native,你可以享受到以下优势: - **更高的性能**:由于可以直接调用操作系统API,Tomcat的网络I/O...
启动Tomcat后,查看日志文件,如`catalina.out`,应能看到类似“Using APR based OpenSSL Engine”这样的信息,这意味着APR已经成功加载。 通过以上步骤,你就为基于Java的Tomcat安装了APR支持,并启用了Tomcat ...
查了一下,需要一个apr支持,然后按提示去 下载 http://tomcat.heanet.ie/native/1.1.9/binaries/win32//tcnative-1.dll 将这个文件复制到C:WINDOWSsystem32下面 或者将这个文件放到Tomcat下的bin目录下 再启动...
TOMCAT昨天突然自己宕掉服务了,怎么重起都不行,后来查看logs中catalina.out 日志发现如下错误 INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not ...
解决tomcat 启动 An incompatible version [1.2.14] of the APR based Apache Tomcat Native library 错误,64BIN使用
An incompatible version [1.1.33] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14] 将文件放在:C:\Windows\System32 tcnative-1.dll 1.2.16下载 1.2.14...
### Apache/Tomcat/Nginx 的区别详解 #### Apache HTTP Server Apache HTTP Server 是一个开源的 Web 服务器软件,能够支持多种操作系统平台,包括但不限于 Unix、Linux、Windows 等。它是由 Apache 软件基金会维护...
严重: An incompatible version 1.1.14 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17 该资源为1.1.22版本,之后放到,tomcat/lib或者system32即可
The Apache Tomcat Native Liberay which allows optimal performance in production environments was not found on the java.library.path:E:\java\jdk1.5.0_05
配置springboot环境时报错: ...An incompatible version [1.1.16] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14] 将文件放在:C:\Windows\System32
6. **线程池管理**:Tomcat 8引入了NIO(非阻塞I/O)和Apr(Apache Portable Runtime)连接器,允许更高效地处理并发连接,提升了服务器的并发性能。 7. **管理工具**:Tomcat 8提供了web-based的管理控制台,管理...
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path 2、第二个错误,错误详情: Exception in thread “main” ...
描述中提到的错误"An incompatible version [1.2.14] of the APR based Apache Tomcat Native library"通常发生在用户试图使用一个与当前Tomcat版本不兼容的Tomcat Native库时。这个问题可能会导致Tomcat启动失败或...
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.6.0_04\jre\bin;C:\Program ...