title: Error creating bean with name 'dataSource': Requested bean is currently in creation
body: <blockquote>
    <p>I have problem in build this project, I can not properly configure the dataSource bean.I recently updated the Config class.May be instanciation of Datasource creating the problem.</p>
  </blockquote>
  
  <p>application.properties</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql://localhost:3306/xyz?createDatabaseIfNotExist=true
  spring.datasource.username=root
  spring.datasource.password=root
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  
  
  
  server.port = 8081
  </code></pre>
  
  <p>Bean definition</p>
  
  <pre><code>@Bean
  
  public DataSource dataSource() {
      final DriverManagerDataSource dataSource = new DriverManagerDataSource();
      dataSource.setDriverClassName(env.getProperty("spring.datasource.driver-class-name"));
      dataSource.setUrl(env.getProperty("spring.datasource.url"));
      dataSource.setUsername(env.getProperty("spring.datasource.username"));
      dataSource.setPassword(env.getProperty("spring.datasource.password"));
      return dataSource;
  }
  </code></pre>
  
  <p>But get following Exception,that i can not resolve.</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSource': Requested bean is currently in creation: Is there an unresolvable circular reference?
  </code></pre>