问题
I'm trying to start a tomcat instance(the only tomcat I have), and I'm getting some weird problems, I know that this error:
Failed to initialize end point associated with ProtocolHandler
is because some other application is using the same port, but if I change the port in the server.xml and run the startup.bat again I get the same error but now pointing to the new port, every time y change it I get the same error, also I check for other apps listening the same port using the command netstat -ano | find "9080", I tried this on 3 different machines (2 win7, 1 win server 2008), has anyone faced this problem before?
Feb 13, 2014 1:25:22 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-9080"] Feb 13, 2014 1:25:22 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-9443"] Feb 13, 2014 1:25:23 PM org.apache.coyote.AbstractProtocol init SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-9443"] Throwable occurred: java.io.IOException: ${jazz.connector.sslProtocol} SSLContext not available at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:475) ...
Thanks
回答1:
I have refer this page to configure https (SSL ) for my local tomcat or tomcat in my eclipse.
After doing 3 steps mention above link, When i am trying to start my server I got below Exception during startup:
SEVERE: Failed to initialize end point associated with ProtocolHandler [http-bi o-8443] java.io.IOException: Cannot recover key at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:54
4)
Because it related with below exception :
java.io.IOException: Keystore was tampered with, or password was incorrect at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:772)
Problem is when i try to change server.xml i did not supply correct password value on keystorePass
and keyPass
as below.
When i am generating keystore using below command I have entered changeit as password for keystore. But when i am configuring in server.xml file for https i was supplying different password.
Command : $Tomcat\bin>keytool -genkey -alias mkyong -keyalg RSA -keystore c:\mkyongkeystore
I was having this
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="c:\mkyongkeystore"
keystorePass="password" />
I change to
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="conf/srccodes.jks"
keystoreType="JKS"
keystorePass="changeit"
keyPass="changeit" />
It worked for me.
来源:https://stackoverflow.com/questions/21766491/starting-tomcat-failed-to-initialize-end-point-associated-with-protocolhandler