的applicationContext.xmlPropertyPlaceholderConfigurer不能忽略属性文件甚至ignoreResourceNotFound =真
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound" value="true"/>
<property name="location" value="file:/#{contextParameters.emsPropLocation}"/>
</bean>
<!-- TIBCO Connection Factory Bean -->
<bean id="tibcoConnectionFactory" class="com.tibco.tibjms.TibjmsConnectionFactory" lazy-init="true">
<constructor-arg value="${emsServerURL}"/>
<property name="userName" value="${emsUserName}"/>
<property name="userPassword" value="${emsPassword}"/>
<property name="connAttemptCount" value="${connAttemptCount}"/>
<property name="connAttemptDelay" value="${connAttemptDelay}"/>
<property name="connAttemptTimeout" value="${connAttemptTimeout}"/>
<property name="reconnAttemptCount" value="${reconnAttemptCount}"/>
<property name="reconnAttemptDelay" value="${reconnAttemptDelay}"/>
<property name="reconnAttemptTimeout" value="${reconnAttemptTimeout}"/>
</bean>
的web.xml
<context-param>
<param-name>emsPropLocation</param-name>
<param-value>D:/nsserver/config/EMSServerConf.properties</param-value>
</context-param>
如果EMSServerConf.properties文件不存在时指定的位置,“org.springframework.web.context.ContextLoaderListener”侦听器无法正确加载applicationContext.xml文件。尽管ignoreResourceNotFound属性设置为“true”。
其实,我想让这个属性文件是可选的。
错误在Tomcat服务器
2011年12月1日下午6时08分51秒开始org.apache.catalina.core.StandardContext严重 :错误listenerStart 2011年12月1日下午6时08分51秒org.apache.catalina.core.StandardContext开始 重度:上下文[/上传]启动失败由于先前的错误
我坚持不好... :(
可能的重复[我们可以加载“org.springframework.beans.factory.config.PropertyPlaceholderConfigurer”bean with lazy-init =“true”?](http://stackoverflow.com/questions/8337652/can-we -load-org-springframework-beans-factory-config-propertyplaceholderconfigu) – axtavt
'ignoreUnresolvablePlaceholders' –
我试图设置ignoreUnresolvablePlaceholders = true,但它没有奏效。 – user1065374