java - Spring 3.2 PropertySourcesPlaceholderConfigurer 与 JBoss EAP 6.2

标签 java spring jboss-eap-6

我希望 Spring 首先检查 JBoss EAP 6.2(使用 JBoss AS 7.2)中的系统属性,然后检查位于 jar 内的属性。

我试过了

<context:property-placeholder location="classpath:xxx.properties" />

但这使用 jar 中的属性而不是 JBoss 的系统属性。 我也尝试过

<context:property-placeholder location="classpath:xxx.properties" system-properties-mode="OVERRIDE" />

这应该使用旧的 PropertyPlaceholderConfigurer,但这也仍然使用 jar 中的属性。我还尝试设置 3.0(而不是 3.2)spring xsd 但无济于事。

那么如何让Spring先检查JBoss中的属性,然后再检查jar中的属性呢?

编辑:我尝试用其他选项(ENVIRONMENT、NEVER 和 FALLBACK)替换 OVERRIDE,但最终总是得到本地属性中定义的值。

最佳答案

在 Artem Bilan 发表评论后,我再次搜索(只是为了确保没有重复项),并找到了一个加载相同属性的类,但在 Java 中(Properties.load())。这会导致覆盖我试图通过 Spring 加载的系统属性

关于java - Spring 3.2 PropertySourcesPlaceholderConfigurer 与 JBoss EAP 6.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22914888/

相关文章:

java - 为什么 Google 的 Gson 不是静态的?

java - SonarQube IntelliJ 插件如何对新代码运行检查

spring - kotlin 中的数字不可序列化

java - 为什么 JBoss EAP 6.4 无法使用 http session 复制机制加载 session ?

java - 从 Eclipse 远程调试服务器 Jboss eap 6.4 失败

java - 从 LKM/kernel-space 启动 Android Activity

java - java while循环后的执行流程

Java Spring JDBC模板问题

javascript - 不支持请求方法 'OPTIONS' - Spring Boot 应用程序

java - 在部署时覆盖 Jboss EAP 6.4 中 web.xml 中的上下文参数