从Mule 3.8中的.properties文件加载时出现FilenotFound异常

时间:2016-11-07 00:50:26

标签: deployment dependency-properties mule-studio filenotfoundexception anypoint-studio

我从Git存储库导入了一个项目。当我尝试部署到ESB时,部署失败并报告它无法找到属性文件。 //org.springframework.beans.factory.BeanInitializationException:无法加载属性;嵌套异常是java.io.FileNotFoundException:无法打开类路径资源[config.properties],因为它不存在     在org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBean 工厂(PropertyResourceConfigurer.java:89)〜[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors     (PostProcessorRegistrationDelegate.java:265)〜[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors     (PostProcessorRegistrationDelegate.java:162)~ [spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]

我正在使用属性文件获取多个环境详细信息,并根据环境名称提取文件并在src / main / resources文件夹下复制。但即使我能够看到文件被正确拾取并复制到位置src / main / resources。 其他人似乎已经能够成功部署它。我尝试将属性文件移动到src / main / resources文件夹,结果相同。 为什么ESB不能找到位于/ src / main / resources中的属性文件?

以下是代码段:     

1 个答案:

答案 0 :(得分:0)

将config.properties文件保存在类路径中并按以下方式引用

=
相关问题