title: Not able to access Message Source in Spring Boot 2.1.1.RELEASE
body: <p>I am using the Spring Boot 2.1.1.RELEASE where in I am not able to access the configured Message Source.</p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.1.1.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; 
   &lt;/parent&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KhBAw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KhBAw.jpg" alt="Folder Structure"></a></p>
  
  <pre><code>@SpringBootApplication
  public class RestfulWebservicesApplication {
  
      //......... some code
  
      //......... some code
  @Bean
  public LocaleResolver localeResolver() {
      SessionLocaleResolver resolver = new SessionLocaleResolver();
      resolver.setDefaultLocale(Locale.US);
      return resolver;
  }
  
   @Bean
   public MessageSource resourceBundleMessageSource() {
      ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource ();
      resourceBundleMessageSource.setBasename("classpath:messages");
      return resourceBundleMessageSource;
  }
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/46659679/spring-boot-application-and-messagesource">Above approach is from another SO question</a></p>
  
  <p>Below is the my restcontroller class method:</p>
  
  <pre><code>@GetMapping("/hello-world-I18N")
  public String helloWorldI18N(@RequestHeader(name="Accept-Language",required = false) Locale locale) {
      return messageSource.getMessage("good.morning.message",null,locale);
  }
  </code></pre>
  
  <p>Get Request from POSTMAN:
  <a href="https://i.stack.imgur.com/tLY3A.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tLY3A.jpg" alt="enter image description here"></a></p>
  
  <p>In Debug log auto configuration did not match.</p>
  
  <blockquote>
    <p>MessageSourceAutoConfiguration:
          Did not match:
                - ResourceBundle did not find bundle with basename messages (MessageSourceAutoConfiguration.ResourceBundleCondition)</p>
  </blockquote>
  
  <p>I did tried the other way where in the configuration have been detected but the error was same as highlighted.</p>
  
  <pre><code> @Bean
   public MessageSource resourceBundleMessageSource() {
      ReloadableResourceBundleMessageSource resourceBundleMessageSource = new ReloadableResourceBundleMessageSource ();
      resourceBundleMessageSource.setBasename("messages");
      return resourceBundleMessageSource;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uvu82.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uvu82.jpg" alt="Other Approach without message folder"></a></p>
  
  <pre><code>MessageSourceAutoConfiguration:
    Did not match:
       - @ConditionalOnMissingBean (types: org.springframework.context.MessageSource; SearchStrategy: current) found beans of type 'org.springframework.context.MessageSource' resourceBundleMessageSource (OnBeanCondition)
    Matched:
       - ResourceBundle found bundle URL [file:/C:/Users/gaura/IdeaProjects/restful-webservices/target/classes/messages.properties] (MessageSourceAutoConfiguration.ResourceBundleCondition)
  </code></pre>
  
  <p>content of messages.properties:
  good.morning.message=Good Morning</p>
  
  <p>Does it is the issue with current Spring Boot 2.1.1.RELEASE just like the <a href="https://stackoverflow.com/questions/30663513/spring-boot-messagesourceautoconfiguration">other version</a>???</p>