title: Unsatisfied Dependency Error through field in Spring
body: <p>below code is working fine but if i comment the jdbcTemplateRandomName method in OracleConfiguration class i get the below error : -</p>
  
  <p>I am trying to understand why i am getting the error by commenting jdbcTemplateRandomName method
  Error is in BaseDaoImpl class.</p>
  
  <blockquote>
    <p>Exception in thread "main"
    org.springframework.beans.factory.UnsatisfiedDependencyException:
    Error creating bean with name 'baseDaoImpl': Unsatisfied dependency
    expressed through field 'jdbcTemplate'; nested exception is
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No
    qualifying bean of type 'org.springframework.jdbc.core.JdbcTemplate'
    available: expected at least 1 bean which qualifies as autowire
    candidate. Dependency annotations:
    {@org.springframework.beans.factory.annotation.Autowired(required=true)}</p>
    
    <p>Caused by:
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No
    qualifying bean of type 'org.springframework.jdbc.core.JdbcTemplate'
    available: expected at least 1 bean which qualifies as autowire
    candidate. Dependency annotations:
    {@org.springframework.beans.factory.annotation.Autowired(required=true)}</p>
  </blockquote>
  
  <pre><code>@Component
      public class BaseDaoImpl {
  
          @Autowired
          private JdbcTemplate jdbcTemplate;
  
  
              public JdbcTemplate getJdbcTemplate() {
                                  return jdbcTemplate;
              }
  @Configuration   
   public class OracleConfiguration {
  
          @Bean
          DataSource dataSource() throws SQLException {
  
              OracleDataSource dataSource = new OracleDataSource();
              //removed code for brevity setting username,password to datasource
              return dataSource;
          }
  
          @Bean
           public JdbcTemplate jdbcTemplateRandomName(DataSource dataSource) {
             JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
             jdbcTemplate.setResultsMapCaseInsensitive(true);
              return jdbcTemplate;
          }
  
      public class RolesDaoImpl  extends BaseDaoImpl implements RolesDao  {
  
      //removed lot of unnecessary  code for the question
      List&lt;Roles&gt; rolesList  = getJdbcTemplate().query(sql,
                      new BeanPropertyRowMapper&lt;Roles&gt;(Roles.class));
  </code></pre>