`
顽石OK07
  • 浏览: 83824 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

Tomcat启动错误:The Apache Tomcat Native library was not found解决

阅读更多

转载:http://ajava.org/exep/apache/15996.html

 

 

Tomcat启动的时候出现下面这样的提示:

2006 - 1 - 26   19 : 44 : 11 org.apache.catalina.core.AprLifecycleListener lifecycleEvent   
 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Java\jdk1. 5 .0_05\bin;.;C:\WINDOWS\system32;C:\WINDOWS;d:\ruby\bin;.;..;D:\Java\jrockit-R26. 0.0 -jdk   

如果想使用apr的话, 实际操作很简单,

下载 http://tomcat.heanet.ie/native/1.1.1/binaries/win32/tcnative-1.dll

将这个文件复制到C:\WINDOWS\system32\下面

然后重新启动tomcat,就会发现tomcat 的控制台信息为:
2006-1-26 19:48:42 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-9080

这时候如果还有错误提示,注意看上面的版本信息,这是由于你当前的tamcat版本与tcnative-1.dll 分版本不佩服的问题,进入http://tomcat.heanet.ie/native 找到相应版本的文件重新下载替换刚才的就可以了。

详情见 http://tomcat.apache.org/tomcat-5.5-doc/apr.html

另一个说法:

在从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

这样就配置成功了。性能方面目前没有做详细的测试。

 

 

 

 

分享到:
评论

相关推荐

    启动tomcat出错The Apache Tomcat Native library which allows optimal performance in production environments was not found

    怎么重起都不行,后来查看logs中catalina.out 日志发现如下错误 INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /...

    tomcat启动的问题--apr

    信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Java\jre1.5.0_11\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\...

    was not found on the java.library.path

    标题 "was not found on the java.library.path" 是一个在Java编程中常见的错误提示,它意味着系统在尝试加载本地库(native library)时未能找到指定的库文件。这通常发生在Java程序试图使用Java Native Interface ...

    ecplise中启动Tomcat错误.not found on the java.library.path

    在使用Eclipse集成开发环境(IDE)启动Apache Tomcat服务器时,可能会遇到“not found on the java.library.path”这样的错误。这个错误通常涉及到Java的动态链接库(JNI)加载问题,与系统路径设置有关。本文将深入...

    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" 指的是在启动Apache Tomcat时遇到的一个错误,...

    Tomcat Native Liberay 文件

    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

    CentOS 6.5上的Tomcat启动报错问题解决方法

    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” ...

    tomcat-native.tar.gz-------tomcat会报的错误

    e in production environments was not found on the java.library.path: D:\Tomcat 6 .0\bin;.;C:\WINNT\Sun\Java\bin;C:\WINNT\system32;C:\WINNT;c:\j2sdk1.4.2_05\bin;D :\Oracle\Ora81\bin;C:\Program Files\...

    解决eclpise中启动tomcat6出现红色警告的问题

    信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\study tools\Java\jdk1.5.0_06\bin;.;C:\WINDOWS\...

    tcnative-1.dll

    The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: ...... 意思是说在产品环境下可以优化工作性能的Tomcat的本地包没有找到...

    tcnative-1.dll各个版本整合

    Tomcat启动: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

    有关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 ...

    各个版本tcnative-1.dll

    解决tomcat启动时如下异常:The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

    tcnative-1.dll(最新tomcat-native-1.2.21-openssl-1.0.2q 含32/64)

    1.解决:The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path... 2.用法:win+R 到C:\Windows\System32里面去 ,...

    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 ...

    tcnative-1.dll 1.1.24(win32)

    解决问题:在启动Tomcat 7.0时发现第一...The Apache Tomcat Native library which allows optimal performance in production environments was not found 。将tcnative-1.dll文件放入tomcat/bin目录中,即可解决问题

    tcnative-1.dll1.4.8

    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\bin 用tcnative-1.dll1.4.8...

Global site tag (gtag.js) - Google Analytics