title: How to clear ResourceBundle cache
body: <p>This is a webapp running on Tomcat, using Guice.  According to the docs we should be able to call <code>ResourceBundle.clearCache();</code> to clear the ResourceBundle cache and presumably get the latest from the bundle property files.</p>
  
  <p>We have also tried the following:</p>
  
  <pre><code>Class klass = ResourceBundle.getBundle("my.bundle").getClass().getSuperclass();
  Field field = klass.getDeclaredField("cacheList");
  field.setAccessible(true);
  ConcurrentHashMap cache = (ConcurrentHashMap) field.get(null);
  cache.clear(); // If i debug here I can see the cache is now empty!
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ResourceBundle.clearCache(this.class.getClassLoader());
  </code></pre>
  
  <p>The behavior that I am expecting is: </p>
  
  <ol>
  <li>Start up tomcat and hit a page and it says 'Hello World' </li>
  <li>Change the properties file containing 'Hello World' to 'Goodbye Earth'</li>
  <li>Clear the cache using a servlet</li>
  <li>Hit the page and expect to see 'Goodbye Earth'</li>
  </ol>
  
  <p>So question is, how is ResourceBundle.clearCache() actually working ?  And is there some generic file cache we need to clear also ?</p>