错误信息的上下文:
INFO: Initializing ProtocolHandler[“http-bio-9099”]
Dec 11, 2019 5:28:45 PM org. apache. tomcat. util. net. jsse.JSSESocketFactorygetStore
SEVERE: Failed to load keystore type JKS with path C:\MyApp\apache-tomcat-7.0.61/1ib/keystore due to C:\MyApp \apache-tomlcat-7. 0.61\lib\keystore (The system cannot find the file specified)
java. io. FileNotFoundException: C:\MyApp\apache-tomcat-7. 0.61\lib\keystore (The system cannot find the file specified)at java. io. FileInputStream. openo (Native Method)
at java. io. FilelnputStream. open (FileInputStream. java:195)
at java. io. FileInputStream. Kinit> (FileInputStream. java:138)
at org. apache. tomcat. uti1. net. jsse. JSSESocketFactory. getStore (JSSESocketFactory. java:422
at org. apache. tomcat.util.net. jsse.JSSBSocketFactory.getkeystore(]SSESocketFactory.java:328)at org. apache. tomcat. util. net. jsse. JSSESocketFactory.getKeyManagers(JSSBSocketFactory. java:586)at org. apache. tomcat. util. net. jsse. JSSESocketFactory. getkeyManagers(JSSESocketFactory. java:526)at org. apache.tomcat. util.net. jisse. JSSESocketFactorv. init(JSSESocketFactory. java:471
at org. apache. tomcat. util. net. jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:218)at org. apache. tomcat. util. net. JIoEndpoint. bind(JIoEndpoint. java : 400)
at org. apache. tomcat.util. net. AbstractEndpoint. init(AbstractEndpoint. java:649)
at org. apache. coyote. AbstractProtocol.init(AbstractProtocol. java:434)
at org. apache. coyote. http11. AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol. java:119)at org. apache. catalina. connector.Connector.initInternal(Connector.java:978)
at org. apache. catalina. util. LifecycleBase. init(LifecvcleBase. java:102
at org. apache. catalina. core. StandardService. initInternal(StandardService. java:559)
at org. apache. catalina. util. LifecycleBase. init(LifecycleBase. java:102
既然说系统找不到lib文件夹下的keystore文件,我们就自己生成一个.
使用命令行工具keytool生成一个自我认证证书:(用户向别的用户/服务认证自己)
keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048
放到tomcat lib文件夹下问题即解决。