设为首页 收藏本站
查看: 1955|回复: 0

[经验分享] Tomcat启动时提示org.apache.catalina.core.AprLifecycleListener...

[复制链接]

尚未签到

发表于 2017-1-7 11:31:39 | 显示全部楼层 |阅读模式
*网上针对此问题提供的文章很多,但多数和我遇到的情况有出入,所以我将其记录于此*

最近开发中需要使用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了。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-325073-1-1.html 上篇帖子: Apache Drill的Logical Plan的语法 下篇帖子: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/RequestContext
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表