title: Getting error Consider defining a bean of type 'org.springframework.jdbc.core.JdbcTemplate' in your configuration
body: <p>I am getting error while running spring-boot application.</p>
  
  <pre><code>2020-01-30 10:33:19.294  WARN 11168 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mailManagerService': Unsatisfied dependency expressed through field 'userRepository'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userRepository': 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)}
  2020-01-30 10:33:19.294  INFO 11168 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
  2020-01-30 10:33:19.309  INFO 11168 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 
  
  Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2020-01-30 10:33:19.434 ERROR 11168 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 
  
  ***************************
  APPLICATION FAILED TO START
  ***************************
  </code></pre>
  
  <p>Description:</p>
  
  <p>Field <code>jdbcTemplate</code> in <code>com.service.el.microservice.user.UserRepository</code> required a bean of type <code>org.springframework.jdbc.core.JdbcTemplate</code> that could not be found.</p>
  
  <p>The injection point has the following annotations:
      - <code>@org.springframework.beans.factory.annotation.Autowired(required=true)</code></p>
  
  <p>Action:</p>
  
  <p>Consider defining a bean of type <code>org.springframework.jdbc.core.JdbcTemplate</code> in your configuration.</p>
  
  <p>But the issue is I have already defined <em>@Bean</em> for <em>JdbcTemplate</em> in the configuration.
  I am using java 1.8, spring-boot: 2.2.4</p>
  
  <p>Can anybody helps me out to get rid of this issue?</p>
  
  <pre><code>
  
  @Configuration
  @Component
  public class someclass {
  
      @Bean
      public DataSource getDatasource() {
          DriverManagerDataSource datasource = new DriverManagerDataSource();
          datasource.setDriverClassName(this.dbDriver);
          datasource.setUrl(this.dbURL);
          datasource.setUsername(this.dbUserName);
          datasource.setPassword(this.dbPassword);
          return datasource;
      }
  
      @Bean
      public JdbcTemplate getJdbcTemplate(DataSource dataSource) {
          return new JdbcTemplate(dataSource);
          //return jdbcTemplate;
      }
  
      @Bean
      public ResourceBundle getQueryResourceBundle() {
          ResourceBundle rb = ResourceBundle.getBundle("query");
          return rb;
      }
  }
  </code></pre>
  
  <p>This is the class where JDBCtemplate has been used</p>
  
  <pre><code>@Repository
  public class AutoEventRepository {
  
      @Autowired JdbcTemplate jdbcTemplate;
      @Autowired ResourceBundle resourceBundle;
      private static final Logger log = LoggerFactory.getLogger(AutoEventRepository.class);
  
      public List&lt;AutoEventVO&gt; getExistPielData(String esn) {
          try{
              List&lt;AutoEventVO&gt; List = jdbcTemplate.query(resourceBundle.getString(AutoEventQueryConstant.GET_EXIST_PIEL_DATA),
              new Object[] { esn }, new existPIELMapper());
              return List;
          }
  </code></pre>