为什么弹簧启动无法在src / main / resources中查找文件

时间:2017-11-21 22:37:44

标签: java spring-boot classpath

我正在尝试根据Spring WS - HTTPS Client-Server Example中的说明为我的Spring Boot App启用HTTPS。密钥库文件PREFIX qb: <http://purl.org/linked-data/cube#> SELECT DISTINCT ?subject WHERE { ?a qb:component ?subject . FILTER regex(str(?subject), "p", "i") } 是使用server-keystore.jks生成的,并与keytool一起放在项目的/ src / main / resources中。在application.properties中,我有以下内容:

application.properties

当我在Eclipse中启动Spring Boot Application时,它会立即失败并出现以下错误:

server.port=9443
server.ssl.key-store=classpath:server-keystore.jks
server.ssl.key-store-password=123456
server.ssl.keyAlias=server-keypair
server.ssl.key-store-type=JKS

如果我在java.io.FileNotFoundException: class path resource [server-keystore.jks] cannot be resolved to URL because it does not exist classpath之前移除server-keystore.jks,则启动过程会持续一段时间,但最终会失败

application.properties

FileNotFoundException: project-root-dir\server-keystore.jks (The system cannot find the file specified) 是我项目的根路径。如何让Spring Boot知道此cert文件的位置?

0 个答案:

没有答案