title: Loading resource bundles: Spring
body: <p>I am trying to use ResourceBundleMessageSource in Spring. Here is my project structure:
  <img src="https://i.stack.imgur.com/G1UlI.jpg" alt="enter image description here"></p>
  
  <p>And here is the xml configuration:</p>
  
  <pre><code>&lt;bean name="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
      &lt;property name="basename"&gt;
          &lt;value&gt;messages&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>When I try to load the application context, I am getting the following exception:</p>
  
  <pre><code>Jun 7, 2012 2:44:00 PM org.springframework.context.support.ResourceBundleMessageSource getResourceBundle
  WARNING: ResourceBundle [messages] not found for MessageSource: Can't find bundle for base name messages, locale en_US
  Exception in thread "main" org.springframework.context.NoSuchMessageException: No message found under code 'user.welcome' for locale 'en_US'.
      at org.springframework.context.support.AbstractMessageSource.getMessage(AbstractMessageSource.java:135)
      at org.springframework.context.support.AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1192)
      at com.pramati.core.MessageResolver.getMessage(MessageResolver.java:19)
  </code></pre>
  
  <p>If I put my resource bundles file directly under resources folder, I am not getting this error. It is working fine. Can someone let me know how could I get this work by putting resource bundles in a subdirectory of src/main/resources?</p>