【发布时间】:2012-01-24 16:07:09
【问题描述】:
在我的 applicationContext.xml 我有这个
<context:property-placeholder location="file:#{ systemProperties['outsideConfigFile'] }" />
我使用 -DoutsideConfigFile=/path/to/my/file.properties(已验证)启动我的 tomcat
这似乎不起作用,我明白了
INFO : org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - Loading properties file from URL [file:#{ systemProperties['outsideConfigFile'] }]
然后
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: (No such file or directory)
有没有人知道如何让它工作?我认为问题在于 spring 无法读取给定的系统属性文件。
非常感谢 -- MB
【问题讨论】:
-
解释一下你的意思,它似乎不起作用?
-
“似乎不起作用”是什么意思?你有例外吗?弹簧不加载?春天说房产没有价值?
-
更新问题,对不起,好点。
标签: java spring configuration