【发布时间】:2011-12-01 12:42:29
【问题描述】:
applicationContext.xml
<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 开始 严重:上下文 [/upload] 由于以前的错误而启动失败
我卡得很厉害... :(
【问题讨论】:
-
ignoreUnresolvablePlaceholders -
我尝试设置 ignoreUnresolvablePlaceholders=true 但没有成功。
标签: spring