Tomcat 部署 The APR based Apache Tomcat Native ...

Tomcat启动时提示org.apache.catalina.core.AprLifecycleListener…

ApacheTomcatJavaJNIIE
网上针对此问题提供的文章很多,但多数和我遇到的情况有出入,所以我将其记录于此

最近开发中需要使用Tomcat,随意找来个较新的版本6.0.20就用。发现启动时提示:
“2010-5-12 18:06:06 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: …”,打印出的路径包括了%JAVA_HOME%/bin,%SystemRoot%/system32(WindowsXP),以及系统变量path的值。

在http://tomcat.apache.org/tomcat-6.0-doc/apr.html中,可以看到对APR的介绍:

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.


而且其安装需要以下组件的支持:

* APR library
* JNI wrappers for APR used by Tomcat (libtcnative)
* OpenSSL libraries

在网上搜索到的结果中,给出如下的方案:
“到http://tomcat.heanet.ie/native/站点下载符合本地环境的tcnative-1.dll,然后拷贝到%SystemRoot%/system32下,重启Tomcat即可”,
这么简单?好吧。我来到http://tomcat.heanet.ie/native/发现最新的版本为1.1.14,而README提示稳定版本为1.1.12。下载完毕,拷贝到system32下,重启Tomcat,报错:

2010-5-12 17:55:42 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.12.
2010-5-12 17:55:42 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2010-5-12 17:55:43 org.apache.coyote.http11.Http11AprProtocol init
严重: Error initializing endpoint
org.apache.tomcat.jni.Error: ??????????ó??Э?鲻?????????
at org.apache.tomcat.jni.Socket.create(Native Method)
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:612)
at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:107)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
at org.apache.catalina.startup.Catalina.load(Catalina.java:535)
at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
。。。

首先声明的是,这个APR到底能给我带来什么样的实惠,我不清楚;但可以确定的是其安装所需的条件我是满足的,所以那就是拷贝的路径不正确。可是,换到%JAVA_HOME%/bin下仍然报同样的错误,那应该拷到哪里呢?我的同事建议我拷到%CATALINA_HOME%/bin下,这倒提醒了我。拷贝,重启,仍然报错。。。

看来应该是tcnative-1.dll版本的问题了。到apache tomcat站点重新下载了两个最新的版本:5.5.29,6.0.26,解压一看,问题明白了:tcnative-1.dll的最新版本为1.1.20,位置在/bin目录下,我将其拷贝到tomcat6.0.20的/bin下,重启,正常:
“2010-5-12 18:47:45 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.20.
2010-5-12 18:47:45 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2010-5-12 18:47:45 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-9000
2010-5-12 18:47:45 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2010-5-12 18:47:45 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 862 ms
2010-5-12 18:47:45 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-5-12 18:47:45 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.20
2010-5-12 18:48:06 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-9000
2010-5-12 18:48:06 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2010-5-12 18:48:06 org.apache.catalina.startup.Catalina start
信息: Server startup in 20997 ms
2010-5-12 18:48:59 org.apache.coyote.http11.Http11AprProtocol pause
信息: Pausing Coyote HTTP/1.1 on http-9000
2010-5-12 18:48:59 org.apache.coyote.ajp.AjpAprProtocol paus

到此,这个问题告一段落,原因应该就是我随意拿了一个Tomcat就用导致的,也就是说使用的distribution“ not include the Windows service wrapper nor the compiled APR/native library for Windows”。
至于最新的tcnative-1.dll和Tomcat Native的相关资源可以访问http://tomcat.apache.org/native-doc/,http://tomcat.heanet.ie/native/下的严重out了。

Tomcat 部署 The APR based Apache Tomcat Native ...,布布扣,bubuko.com

时间: 2024-07-31 14:33:18

Tomcat 部署 The APR based Apache Tomcat Native ...的相关文章

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 optimal performance in production environments was not found on the java.library.path: D:\Develop\jdk7\jdk1.7.0_79\bin;C:\Windows\Sun\Java\bin;C:\Windows

解决Tomcat启动时出现的The APR based Apache Tomcat Native library异常

现在用的tomcat6.0,不知道大家注意没有,在启动的时候,那个启动窗口最上面出现这样一条信息: 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: 这实际上是tomcat推荐使用apache的apr 需要下载tcnative-1.dll 下载后放到tom

Loaded APR based Apache Tomcat Native library 1.1.24 using APR version 1.4.6.

Loaded APR based Apache Tomcat Native library 1.1.24 using APR version 1.4.6. 我复制的几个地方: MySql C:\WINDOWS\system32\ jdk \bin文件夹下都要复制此文件

信息: 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 production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre1.8.0_111\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Win

启动报The APR based Apache Tomcat Native library which allows optimal performance in production environ

mnesia在频繁操作数据的过程可能会报错:** WARNING ** Mnesia is overloaded: {dump_log, write_threshold},可以看出,mnesia应该是过载了.这个警告在mnesia dump操作会发生这个问题,表类型为disc_only_copies .disc_copies都可能会发生. 如何重现这个问题,例子的场景是多个进程同时在不断地mnesia:dirty_write/2 mnesia过载分析 1.抛出警告是在mnesia 增加dump

The APR based Apache Tomcat Native library tomcat启动错误

The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 由代码可知是缺少APR模块导致的错误. 1.安装APR wget http://apache

Tomcat新问题 还没有解决:the apr based apache tomcat native librariy which allows optional perf...........

问题信息详细: 2012-5-18 18:41:54 org.apache.catalina.core.AprLifecycleListener init 信息: 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\jdk

出现错误日志: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 production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 解决: 通过安装和配置apr解决. Tomcat Na

An incompatible version 1.1.14 of APR based Apache Tomcat Native library is installed, while Tomcat

启动tomcat 7.0, 看到日志里出现严重警告, An incompatible version 1.1.14 of APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.24.就上网查了查,APR是Apache portable Runtime的缩写,是tomcat的一个可选组件,这个工程组件在tomcat中的使用增进了稳定性和性能,特别是当tomcat也用于web服务器