gpt4 book ai didi

java - Spring找不到 key 存储文件

转载 作者:行者123 更新时间:2023-11-30 02:35:36 25 4
gpt4 key购买 nike

我有这个文件结构;

enter image description here

然后在我的 beans xml 配置上;

enter image description here

但是当我启动服务器时,我得到一个 FileNotFoundException/store/thestore.jks

我错过了什么?提前致谢。

最佳答案

根据这里的源代码com.noelios.restlet.util.DefaultSslContextFactory.createSslContext()

190            FileInputStream keyStoreInputStream = null;
191 try {
192 keyStoreInputStream = ((this.keyStorePath != null) && (!"NONE"
193 .equals(this.keyStorePath))) ? new FileInputStream(
194 this.keyStorePath) : null;
195 keyStore.load(keyStoreInputStream, this.keyStorePassword);

它使用FileInputStream,这意味着它将尝试从文件系统而不是从 JAR 本身读取文件。

您必须将 jks 文件放在 JAR 之外并提供它的绝对路径。

例如

<prop key="keyStorePath">C:/store/thestore.jks</prop>

关于java - Spring找不到 key 存储文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43187563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com