title: Spring Autowire with Bean creation in same class results in :Requested bean is currently in creation Error*
body: <p>I know the error is self explanatory, but when I remove the setting of rest template from constructor to @Autowired @Qualifier("myRestTemplate") private RestTemplate restTemplate, it works.</p>
  
  <p>Just want to know how can I do that in constructor if the same class has bean definition of what I am trying to autowire? </p>
  
  <blockquote>
    <p>org.springframework.beans.factory.BeanCurrentlyInCreationException:
    Error creating bean with name 'xxx': Requested bean is currently in
    creation: Is there an unresolvable circular reference?</p>
  </blockquote>
  
  <pre><code>@Component
  public class xxx {
  
   private RestTemplate restTemplate;
  
   @Autowired
   public xxx(@Qualifier("myRestTemplate") RestTemplate restTemplate) {
     this.restTemplate = restTemplate;
   }
  
   @Bean(name="myRestTemplate")
   public RestTemplate getRestTemplate() {
      return new RestTemplate();
   }
  
  }
  </code></pre>