长属性文件导致m子启动错误

时间:2018-07-24 10:38:30

标签: mule mule-studio properties-file

在运行m子应用程序时,我面临一个奇怪的问题。我们在mule-app.properties中有多个条目(220行) )。当我尝试运行该应用程序时,它失败并显示file or extension too错误。

enter image description here

当我从属性文件中删除一些随机条目时,应用程序成功启动。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

我有一个类似的问题,这是因为在运行时应用mule-app.properties中的条目的方式。 JVM抱怨VM参数太长,这就是如何应用mule-app.properties中的属性。

解决方法是将属性存储在.properties中单独的src/main/resources文件中,并将此文件作为属性占位符包含在全局配置中:

<context:property-placeholder location="myApp.properties"/>

请注意,如果您使用像这样的特定于环境的属性,也可以引用多个用逗号分隔的文件,例如

<context:property-placeholder location="myApp.properties, ${mule.environment}.properties" />