Protocol handler initialization失败:

时间:2011-03-09 12:02:33

标签: java tomcat tomcat6

当我尝试启动Tomcat 6.0时,我遇到了这样的错误,

所以你可以给我一些解决方案吗

Mar 9, 2011 5:29:00 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Java/jre6/bin/client;C:/Java/jre6/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Java\jdk1.5\bin\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Liquid Technologies\Liquid XML Studio 2009\XmlDataBinder7\Redist7\cpp\win32\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.0\bin
Mar 9, 2011 5:29:00 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8081
Mar 9, 2011 5:29:00 PM org.apache.tomcat.util.net.jsse.JSSESocketFactory getStore
SEVERE: Failed to load keystore type JKS with path C:\Documents and Settings\sanjay.prajapati/.keystore due to C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
java.io.FileNotFoundException: C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:347)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:269)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:482)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:419)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:130)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1014)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:680)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
    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:260)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
Mar 9, 2011 5:29:00 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.io.FileNotFoundException: C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:347)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:269)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:482)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:419)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:130)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1014)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:680)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
    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:260)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
Mar 9, 2011 5:29:00 PM org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
LifecycleException:  Protocol handler initialization failed: java.io.FileNotFoundException: C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1016)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:680)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
    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:260)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
Mar 9, 2011 5:29:00 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 506 ms
Mar 9, 2011 5:29:00 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 9, 2011 5:29:00 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.26
Mar 9, 2011 5:29:00 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8081
Mar 9, 2011 5:29:00 PM org.apache.tomcat.util.net.jsse.JSSESocketFactory getStore
SEVERE: Failed to load keystore type JKS with path C:\Documents and Settings\sanjay.prajapati/.keystore due to C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
java.io.FileNotFoundException: C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:347)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:269)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:482)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:419)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:130)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:565)
    at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:203)
    at org.apache.catalina.connector.Connector.start(Connector.java:1087)
    at org.apache.catalina.core.StandardService.start(StandardService.java:534)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    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.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Mar 9, 2011 5:29:00 PM org.apache.coyote.http11.Http11Protocol start
SEVERE: Error starting endpoint
java.io.FileNotFoundException: C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:347)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:269)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:482)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:419)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:130)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:565)
    at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:203)
    at org.apache.catalina.connector.Connector.start(Connector.java:1087)
    at org.apache.catalina.core.StandardService.start(StandardService.java:534)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    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.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Mar 9, 2011 5:29:00 PM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start: 
LifecycleException:  service.getName(): "Catalina";  Protocol handler start failed: java.io.FileNotFoundException: C:\Documents and Settings\sanjay.prajapati\.keystore (The system cannot find the file specified)
    at org.apache.catalina.connector.Connector.start(Connector.java:1094)
    at org.apache.catalina.core.StandardService.start(StandardService.java:534)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    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.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Mar 9, 2011 5:29:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 302 ms

4 个答案:

答案 0 :(得分:3)

要删除tomcat密钥库的错误,您只需要从server.xml 删除下面的条目

管理SSL配置的相关链接links

Tomcat 3.2的语法:

<Connector className="org.apache.tomcat.service.PoolTcpConnector"> 
<Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/> 
<Parameter name="port" value="8443"/> 
<Parameter name="socketFactory" value="org.apache.tomcat.net.SSLSocketFactory" /> 
<Parameter name="keystore" value="/var/tomcat/conf/keystore" /> 
<Parameter name="keypass" value="mynewpass"/> 
<Parameter name="clientAuth" value="false"/> 
</Connector>

Tomcat 3.3的语法:

<Http10Connector 
  port="8443" 
  secure="true" 
  keystore="/var/tomcat/conf/keystore" 
  keypass="mynewpass" 
  clientauth="false" />

重新启动tomcat它不应该显示错误

答案 1 :(得分:3)

对于Tomcat 7.x及更高版本,添加&#39; keystoreFile&#39;和&#39; keystorePass&#39;属性为[Tomcat-Home] /conf/server.xml文件中的SSL连接器定义,如下所示:

    <Connector port="8443" 
           protocol="org.apache.coyote.http11.Http11Protocol"
           SSLEnabled="true" 
           maxThreads="150" 
           scheme="https" 
           secure="true"
           clientAuth="false" 
           sslProtocol="TLS"
           keystoreFile="C:\cert\myTomcatKeytool.jks"  
           keystorePass="123456"
           />

您应该通过open_ssl工具或keytool.exe(位于java / bin文件夹中)生成.jks文件。 谷歌它找出如何。
(Y。Lev)

答案 2 :(得分:0)

对我来说,协议处理程序初始化失败是由“ java.net.BindException:已使用的地址:bind”引起的。 要解决此问题,我必须以管理员身份运行命令提示符。 由于我试图在端口8080上运行,因此我输入了以下命令:

netstat -ano | findStr 8080

这表明该端口实际上正在使用中。然后,我使用以下命令终止任务并清除端口:

TaskKill.exe /F /PID 24216

这杀死了任务,我能够再次在8080端口上运行我的intellij。

答案 3 :(得分:0)

<块引用>

org.apache.catalina.LifecycleException:协议处理程序启动失败

更改 server.port=8080 例如。 server.port=8000