未从属性文件解析全局属性,因此 mmc 部署失败。任何想法为什么可能是错误的?
<context:property-placeholder location="airports.properties" />
<global-property name="airportslist" value="${airportslist}" />
出现以下异常 --
com.mulesoft.mmc.agent.v3.dto.DeploymentException: Unexpected exception parsing XML document from URL [file:/arprt/mule-esb-ee/mule-enterprise-standalone-3.3.0/apps/myapp-1.0.0-SNAPSHOT/myapp-config.xml]; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'airportslist' (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException) at com.mulesoft.mmc.agent.service.impl.ApplicationServiceImpl.deploy(ApplicationServiceImpl.java:245) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
airports.properties contains the above mentioned property:
airportslist={'SFO', 'YYZ', 'DFW'}
最佳答案
如果属性是在属性文件中定义并使用 context:property-placeholder
加载的,则无需声明 global-property
。
只需删除:
<global-property name="airportslist" value="${airportslist}" />
并在配置中任何需要的地方使用 ${airportslist}
。
关于Mule 3.3.0 - 全局属性未从属性文件中解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14782396/