由于长属性文件导致 mule 启动错误
Error in mule start up due to long properties file
我在 运行ning mule 应用程序时遇到一个奇怪的问题。我们在 mule-app.properties 中有多个条目(220 行
).当我尝试 运行 应用程序时,它失败并显示 file or extension too
错误。
当我从属性文件中删除一些随机条目时,应用程序成功启动。任何帮助将不胜感激。
我遇到过与此类似的问题,这是因为运行时应用 mule-app.properties 中的条目的方式。 JVM 抱怨 VM 参数太长,这就是应用 mule-app.properties 中的属性的方式。
解决此问题的方法是将属性存储在 src/main/resources
中的单独 .properties
文件中,并将此文件作为 属性 占位符包含在全局配置中:
<context:property-placeholder location="myApp.properties"/>
请注意,如果您像这样使用特定于环境的属性,您也可以引用多个文件,用逗号分隔,例如
<context:property-placeholder location="myApp.properties, ${mule.environment}.properties" />
我在 运行ning mule 应用程序时遇到一个奇怪的问题。我们在 mule-app.properties 中有多个条目(220 行
).当我尝试 运行 应用程序时,它失败并显示 file or extension too
错误。
当我从属性文件中删除一些随机条目时,应用程序成功启动。任何帮助将不胜感激。
我遇到过与此类似的问题,这是因为运行时应用 mule-app.properties 中的条目的方式。 JVM 抱怨 VM 参数太长,这就是应用 mule-app.properties 中的属性的方式。
解决此问题的方法是将属性存储在 src/main/resources
中的单独 .properties
文件中,并将此文件作为 属性 占位符包含在全局配置中:
<context:property-placeholder location="myApp.properties"/>
请注意,如果您像这样使用特定于环境的属性,您也可以引用多个文件,用逗号分隔,例如
<context:property-placeholder location="myApp.properties, ${mule.environment}.properties" />