title: Spring Bean Creation: Requested bean is currently in creation
body: <p>I have a problem trying to autowire a bean that is defined in the same class.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@Configuration
  public ClassName ..
  
      @Autowired
      @Qualifier("myCustomBean")
      private MyCustomClass myBean;
  
      @Bean("myCustomBean")
      public MyCustomClass getMyCustomBean() {
          MyCustomClass c = new MyCustomClass();
          return c;
      }
  
      @Bean("otherBeanThatIwant")
      public OtherClassOfMyProject() {
          OtherClass oc = new ...
          oc.setMyCustomClass(this.c);
          return oc;
      }
  </code></pre>
  
  <p>This code gives me an error such as: <strong>BeanCreationException</strong>: Error creating bean with name "otherBeanThatIwant"</p>
  
  <p>...
  ...
  ... </p>
  
  <p>Could not autowire field myBean ... .... <strong>BeanCurrentlyInCreationException</strong>.</p>
  
  <p>I google it, but i couldn't find any answer to my problem.</p>
  
  <p>Any clue?</p>
  
  <p>Thanks in advice!
  Greetings</p>