*网上针对此问题提供的文章很多,但多数和我遇到的情况有出入,所以我将其记录于此*
最近开发中需要使用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了。
分享到:
相关推荐
org.apache.catalina.core.AprLifecycleListener myeclipse tomcat 無法啟動 用這個文件
2010-8-11 18:24:13 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the ...
2009-8-29 14:02:04 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 ...
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/> <Listener className="org.apache.catalina.core.JasperListener" /> <Listener className="org.apache.catalina.mbeans...
错误处理在`org.apache.catalina.core.StandardHost`和`StandardContext`中体现。 10. **扩展性**:Tomcat的插件系统允许开发者通过编写Valve(请求处理管道的一部分)来扩展其功能,`org.apache.catalina.valves`...
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> ``` - 重启Tomcat:完成上述配置后,重新启动Tomcat服务器。 **4. 关联标签“源码”和“工具”** - 源码:如果你正在对...
一月 10, 2018 4:52:07 下午 org.apache.catalina.core.AprLifecycleListener init 严重: An incompatible version 1.1.31 of the APR based Apache Tomcat Native library is installed, ...
2008-10-11 21:33:55 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...
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/> <Listener className="org.apache.catalina.core.JasperListener"/> <Listener className="org.apache.catalina.mbeans....
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> ``` 4. **验证安装**:启动Tomcat后,可以通过查看Tomcat日志确认APR和tcnative-1.dll是否成功加载。 请注意,虽然...
然而,从描述中看到的问题是在关闭 Tomcat 时出现了 `[org.apache.catalina.core.AprLifecycleListener]-[INFO] Failed shutdown of Apache PortableRuntime` 的错误。这可能意味着在关闭过程中 APR 库未能正确地...
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> ``` 4. **验证配置**:重新启动Tomcat,如果一切配置正确,你应该能在Tomcat的日志文件中看到`tcnative-1.dll`被成功...
九月 18, 2013 11:39:01 上午 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not ...
factory="org.apache.catalina.core.AprLifecycleListener.factory" aprLibraryName="libapr-1.dll" useAprConnector="true" secretRequired="false"/> ``` 4. **重启Tomcat** 完成上述配置后,重启Tomcat...
`org.apache.catalina.mbeans`和`org.apache.catalina.core`包中的类展示了如何通过JMX接口操作Tomcat的各种组件。 9. **线程池管理**:Tomcat使用线程池处理并发请求,提高了性能。`Executor`接口和相关的实现类如...
- `org.apache.catalina.core.AprLifecycleListener`、`org.apache.coyote.AbstractProtocol`等是预定义的日志配置,针对Tomcat的不同组件。 4. **控制台日志与文件日志** - `.handlers`属性定义了日志处理程序...
-- <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> --> ``` 重启Tomcat后,你应该能够通过HTTPS正常访问你的项目。 如果你想查看或导出证书,可以使用`keytool`工具: 1...
2012-4-16 10:43: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...
<Resource name="Server" auth="Container" type="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> ``` 7. **启动Tomcat**:现在,你可以启动或重启Tomcat服务器,检查是否成功加载了APR/...