本文主要是介绍eclipse启动tomcat报错 Failed to initialize connector [Connector[org.apache.coyote.http11.Http11AprProtoc,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
tomcat版本是tomcat-8.5.42,在server.xml里面开启了APR模式,通过windows服务启动正常,但是通过eclipse启动tomcat出现下面的报错:The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
Aug 10, 2020 5:03:32 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: 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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre7/bin/client;C:/Program Files (x86)/Java/jre7/bin;C:/Program Files (x86)/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jdk1.7.0_79\bin;C:\Program Files (x86)\Apache Software Foundation\apache-tomcat-8.5.42;C:\Users\helpgsc.ASIA\AppData\Local\Microsoft\WindowsApps;C:\eclipse;;.]
Aug 10, 2020 5:03:32 PM org.apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[org.apache.coyote.http11.Http11AprProtocol-8080]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[org.apache.coyote.http11.Http11AprProtocol-8080]]at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552)at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)at org.apache.catalina.startup.Catalina.load(Catalina.java:639)at org.apache.catalina.startup.Catalina.load(Catalina.java:662)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:309)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not availableat org.apache.catalina.connector.Connector.initInternal(Connector.java:978)at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)... 12 moreAug 10, 2020 5:03:32 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Aug 10, 2020 5:03:33 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Aug 10, 2020 5:03:33 PM org.apache.catalina.startup.Catalina load
解决办法:在tomcat的bin路径取中间的tcnative-1.dll文件,然后将该文件放入java.library.path的路径 C:\Program Files (x86)\Java\jre7\bin中。
#备注:如果当前tomcat版本没有tcnative-1.dll文件,下载与tomcat版本一致的tomcat-native-xxx-win32-bin.zip压缩包,并取中间的tcnative-1.dll文件。 提前一个地址 http://archive.apache.org/dist/tomcat/tomcat-connectors/native/
这篇关于eclipse启动tomcat报错 Failed to initialize connector [Connector[org.apache.coyote.http11.Http11AprProtoc的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!