我在嵌入式tomcat遇到麻烦:当我使用嵌入式tomcat运行Spring应用程序时,似乎属性无法解决。

即使已加载属性文件:

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 / st运行我的应用程序时,我没有这样的问题。

有帮助吗?

解决方案

我部分地分类了这个问题。通过删除这里的前导斜杠(在Spring Config中):

<property name="basenames" value="/META-INF/i18n/application,/META-INF/i18n/messages" />
. 为了获得这个:
<property name="basenames" value="META-INF/i18n/application,META-INF/i18n/messages" />
.

问题已解决。 然而,引起了嵌入式Tomcat与标准Tomcat之间的行为的差异,首先引起了差异,我不解释...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top