嵌入式tomcat赢得';t解析消息源的Spring应用程序资源包
我的嵌入式tomcat遇到了问题:当我使用嵌入式tomcat运行Spring应用程序时,属性似乎没有得到解决 即使已加载属性文件:嵌入式tomcat赢得';t解析消息源的Spring应用程序资源包,spring,maven,properties-file,maven-tomcat-plugin,Spring,Maven,Properties File,Maven Tomcat Plugin,我的嵌入式tomcat遇到了问题:当我使用嵌入式tomcat运行Spring应用程序时,属性似乎没有得到解决 即使已加载属性文件: INFO org.springframework.context.support.PropertySourcesPlaceholderConfigurer - Loading properties file from file [/home/julien/Documents/donnees/projets/Site-Rencontres/java/target/c
INFO org.springframework.context.support.PropertySourcesPlaceholderConfigurer - Loading properties file from file [/home/julien/Documents/donnees/projets/Site-Rencontres/java/target/classes/META-INF/i18n/application.properties]
找不到资源包:
WARN org.springframework.context.support.ResourceBundleMessageSource - ResourceBundle [/META-INF/i18n/application] not found for MessageSource: Can't find bundle for base name /META-INF/i18n/application, locale fr
但是,当我从Eclipse/STS运行我的应用程序时,我没有这样的问题。我对问题进行了部分排序。通过删除此处的前导斜杠(在Spring配置中):
要获得此信息:
<property name="basenames" value="META-INF/i18n/application,META-INF/i18n/messages" />
问题解决了
然而,首先是什么导致嵌入式Tomcat和标准Tomcat之间的行为差异,我不解释
<property name="basenames" value="META-INF/i18n/application,META-INF/i18n/messages" />