title: ContextRefresher in spring autowired
body: <p>I have a java application in which one of the classes has ContextRefresher autowired:</p>
  
  <pre><code>public abstract class AbstractConfigurationPersister implements IConfigurationPersister {
  
      @Autowired
      private ContextRefresher contextRefresher;
  
      @Override
      public void forceRefresh() {
          contextRefresher.refresh();
      }
  
  }
  </code></pre>
  
  <p>This autowired bean is giving me problems as from the logs, it says that paramater 1 has an unsatisfied dependency. </p>
  
  <pre><code>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$DataSourceTransactionManagerConfiguration':
  
  Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'application':
  
  Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 
  'ktc.tanalytics.prediction.PredictionBeanConfiguration':
  Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: 
  
  Error creating bean with name 'configurationService' defined in ktc.tanalytics.commons.CommonsBeanConfiguration: 
  Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: 
  
  Error creating bean with name 'zookeeperConfigurationPersister' defined in ktc.tanalytics.commons.CommonsBeanConfiguration: 
  Initialization of bean failed; nested exception is 
  org.springframework.beans.factory.UnsatisfiedDependencyException: 
  Error creating bean with name 'contextRefresher' defined in class path resource [org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.class]:
   Unsatisfied dependency expressed through method 'contextRefresher' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'refreshScope': 
  Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor' 
  defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class]: 
  Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: 
  Failed to instantiate [org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor]: 
  Factory method 'transactionAdvisor' threw exception; nested exception is java.lang.NullPointerException
  </code></pre>
  
  <p>Now, I have checked the code of ContextRefresher in spring (<a href="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ContextRefresher.java" rel="nofollow noreferrer">https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ContextRefresher.java</a>) and it receives two arguments. </p>
  
  <p>I suppose that Spring is responsible of creating this ContextRefresher object since it is basically @Autowired. However I do not know why <em>parameter 1</em> is missing as the log says</p>