Announcement Announcement Module
Collapse
No announcement yet.
Spring's ReloadableResourceBundleMessageSource not finding properties file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring's ReloadableResourceBundleMessageSource not finding properties file

    Hello,

    I have two files under the WEB-INF/i18n directory:
    • application.properties
    • messages.properties

    I have properly configured my ReloadableResourceBundleMessageSource bean as follows (spring mvc):

    Code:
    <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application"
            p:fallbackToSystemLocale="false"/>
    and yet I get this from Spring mvc:
    Code:
    2012-09-03 02:59:45,911 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - Loading properties [application.properties]
    2012-09-03 02:59:45,912 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - No properties file found for [WEB-INF/i18n/application_fr] - neither plain properties nor XML
    2012-09-03 02:59:45,912 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - Loading properties [messages.properties]
    2012-09-03 02:59:45,912 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - No properties file found for [WEB-INF/i18n/messages_fr] - neither plain properties nor XML
    Can anyone please advise? I could move the properties files to the classpath and alter my config accordingly but I'd rather understand what is going on.

    Please note that I have researched the matter before posting here and tracked down the issue to come from here (from ReloadableResourceBundleMessageSource.java):

    Code:
    497   		else {
      498   			// Resource does not exist.
      499   			if (logger.isDebugEnabled()) {
      500   				logger.debug("No properties file found for [" + filename + "] - neither plain properties nor XML");
      501   			}
      502   			// Empty holder representing "not found".
      503   			propHolder = new PropertiesHolder();
      504   		}
    See in full source:
    http://www.docjar.com/html/api/org/s...urce.java.html

    It seems I am not the only one to encounter this issue. Can anyone please provide advice?

    Regards,

    Julien.
Working...
X