【发布时间】:2018-06-23 20:03:26
【问题描述】:
对于初学者,我已经在 stackoverflow 上参考了这些问题,但它们并没有解决我的问题,因此创建了一个新问题:
java.io.IOException: Invalid Keystore format
tomcat 7 ssl invalid keystore format
问题:
在将 SAML 与我的 Jetty Web 应用程序集成时(按照教程:https://developer.okta.com/blog/2017/03/16/spring-boot-saml),我收到以下错误:
org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.RuntimeException: Error initializing keystore
我尝试从多个版本的 JDK 创建密钥库,但对于所有文件,我都收到相同的错误。
我也没有使用 maven。
编辑:
异常跟踪:
unavailable Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.RuntimeException: Error initializing keystore
FAILED o.e.j.s.ServletContextHandler@550dbc7a{/api,null,STARTING}: javax.servlet.ServletException: org.springframework.web.servlet.DispatcherServlet-7b2bbc3@bef2d67e==org.springframework.web.servlet.DispatcherServlet,-1,false org.springframework.web.servlet.DispatcherServlet-7b2bbc3@bef2d67e==org.springframework.web.servlet.DispatcherServlet,-1,false
FAILED
Error Details:
org.springframework.web.servlet.DispatcherServlet-7b2bbc3@bef2d67e==org.springframework.web.servlet.DispatcherServlet,-1,false
Server exiting.
【问题讨论】:
-
是的,我做到了。它给出了解决方案,因为“maven 可能正在过滤掉 jks 文件”。我没有使用我的问题中提到的 Maven。
-
keytool 对这个文件有效吗?试试 C:\Java\jdk_1.7.3\bin>keytool -list keystore.jks
-
我得到“非法选项:keystore.jks”
-
更正:keytool -list -keystore keystore.jks 给出正确的输出。没有错误
标签: java jetty keystore spring-saml okta-api