【发布时间】:2016-03-10 04:02:48
【问题描述】:
我已将我的 Spring Boot 应用程序从 1.2.7.RELEASE 升级到 1.3.0.RELEASE。
Spring Boot 中的 ConfigFileApplicationListener 正在以这种方式加载属性
默认情况下,属性将从以下位置的“application.properties”和/或“application.yml”文件加载:
classpath:
file:./
classpath:config/
file:./config/:
我的应用程序没有文件或文件夹的读写权限,除了 classpath: 和 classpath:config/
所以,当我在启用安全性的情况下启动 tomcat 时,这会导致文件权限问题
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" ".\config\application-default.properties" "read")
我可以在 Spring Boot 中更改什么,以便 ConfigFileApplicationListener 不会搜索除类路径以外的属性的位置:
【问题讨论】:
标签: java spring spring-mvc tomcat spring-boot