错误信息的上下文:
> 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:MyAppapache-tomcat-7.0.61/1ib/keystore due to C:MyApp apache-tomlcat-7. 0.61libkeystore (The system cannot find the file specified)
java. io. FileNotFoundException: C:MyAppapache-tomcat-7. 0.61libkeystore (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
![14d022cdbe7a8033f9efae9e949af1a8.png](https://img-blog.csdnimg.cn/img_convert/14d022cdbe7a8033f9efae9e949af1a8.png)
既然说系统找不到lib文件夹下的keystore文件,我们就自己生成一个.
使用命令行工具keytool生成一个自我认证证书:(用户向别的用户/服务认证自己)
keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048
![568814b1c14f5a50198750f3616f259d.png](https://img-blog.csdnimg.cn/img_convert/568814b1c14f5a50198750f3616f259d.png)
![290e5a4ef2e6c688b1ba34ec267964f1.png](https://img-blog.csdnimg.cn/img_convert/290e5a4ef2e6c688b1ba34ec267964f1.png)
![1493843230cde6095bf502ec785c5839.png](https://img-blog.csdnimg.cn/img_convert/1493843230cde6095bf502ec785c5839.png)
放到tomcat lib文件夹下问题即解决。