title: Spring Application Context refresh at runtime
body: <p>we have a problem in our application. We have to refresh the Application Context at runtime because there are some properties in config.properties that are reloaded when the file change. These properties have to be injected into beans. We refresh the application context when file change. But the application is deployed under JBoss and if a request come when the Application Context is refreshing obviously this request generate the error below:</p>
  
  <pre><code>java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
      at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)
  </code></pre>
  
  <p>So we need to know if there are safer methods to reload properties into the Application Context that don't cause lost requests.
  Also we need to know if the restart of JBoss is better than reload Application Context. Every help will be appreciated. Thank you so much.</p>