【解决】requires the APR/native library which is not available 博客分类: tomcat
程序员文章站
2024-03-21 08:15:28
...
今天从旧的服务器上搬到新服务器时tomcat报错:
严重: Failed to initialize connector [Connector[HTTP/1.1-9001]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-9001]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:821) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.startup.Catalina.load(Catalina.java:638) at org.apache.catalina.startup.Catalina.load(Catalina.java:663) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427) Caused by: org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available at org.apache.catalina.connector.Connector.initInternal(Connector.java:972) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ... 12 more
网络上查了一堆资料,
Windows环境
APR需要安装三个组件:
1、APR library
2、JNI wrappers for APR used by Tomcat (libtcnative)
3、OpenSSL libraries
从http://tomcat.heanet.ie/native/1.1.14/binaries/win32/ ,下载tcnative-1.1.10.dll,tcnative-1.1.10.dll已经包含了上面的三个组件,所以只要把tcnative-1.1.10.dll拷贝到tomcat的bin下就行了。
1、APR library
2、JNI wrappers for APR used by Tomcat (libtcnative)
3、OpenSSL libraries
从http://tomcat.heanet.ie/native/1.1.14/binaries/win32/ ,下载tcnative-1.1.10.dll,tcnative-1.1.10.dll已经包含了上面的三个组件,所以只要把tcnative-1.1.10.dll拷贝到tomcat的bin下就行了。
搞了半天,还是报错!!!最终的解决方案是:将Tomcat7\bin下的tcnative-1.dll拷贝到jdk\bin目录下替换即可。(估计是版本的问题)
小结:tcnative-1.dll不需要下载,至少对于Tomcat7来说是这样,我们可以在其bin目录下找到这个dll。