Java 无法将占位符解析为系统属性:未找到系统属性或环境变量
无法将Java 无法将占位符解析为系统属性:未找到系统属性或环境变量,java,spring,Java,Spring,无法将文件://${server.conf}/his config.properties中的占位符“server.conf”解析为系统属性:未找到系统属性或环境变量 his-config-spring.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www
文件://${server.conf}/his config.properties
中的占位符“server.conf”解析为系统属性:未找到系统属性或环境变量
his-config-spring.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="placeholderConfig"
class="com.napier.core.boc.spring.PropertyPlaceholderConfigurater">
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<value>file:///${server.conf}/his-config.properties</value>
<!-- <value>classpath:his-config.properties</value> -->
</list>
</property>
</bean>
</beans>
文件://${server.conf}/his-config.properties
您的问题是???需要编写什么类型的配置,为什么在从外部获取属性文件时出现此错误。但是我如何通过将该属性文件放入我的类路径来解决。。如何在“placehoderConfig”bean中为“his config.properties”文件配置其各自的属性名“locations”。我仍然需要澄清我的问题。也许我问错了问题,但我面对的是this@Jeet你给了我们很少的细节。Spring需要实际加载一些属性,然后才能使用它们。另外-您实际使用Spring2.5(Spring-tx-2.5.xsd)吗?是的,我使用的是Spring2.5