【问题标题】:Spring Boot 1.3.0.RELEASE default search locations causing FilePermission issuesSpring Boot 1.3.0.RELEASE 默认搜索位置导致 FilePermission 问题
【发布时间】: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


    【解决方案1】:

    始终检查默认位置,因此您无法采取任何措施(简单)来避免此问题。能否请open an issue 描述您的设置、安全配置等?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-02-21
      • 2015-11-03
      • 2020-12-12
      • 2016-02-28
      • 2018-03-28
      • 2017-10-20
      • 2016-04-14
      相关资源
      最近更新 更多