title: Spring Batch - Could not @Autowired SimpleJobLauncher
body: <p>I face the below issue though I have correctly defined SimpleJobLauncher</p>
  
  <p>Description:</p>
  
  <p>Field jobLauncher in com.abcplusd.application.BatchConfig required a bean of type 'org.springframework.batch.core.launch.support.SimpleJobLauncher' that could not be found.</p>
  
  <p>Action:</p>
  
  <p>Consider defining a bean of type 'org.springframework.batch.core.launch.support.SimpleJobLauncher' in your configuration.</p>
  
  <p>The following are my source code..</p>
  
  <pre><code>package com.abcplusd.application;
  
  import org.springframework.batch.core.launch.support.SimpleJobLauncher;
  import org.springframework.batch.core.repository.JobRepository;
  import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
  import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.scheduling.annotation.EnableScheduling;
  
  @Configuration
  @EnableScheduling
  public class BatchScheduler {
      @Bean
      public ResourcelessTransactionManager transactionManager() {
          return new ResourcelessTransactionManager();
      }
  
      @Bean
      public MapJobRepositoryFactoryBean mapJobRepositoryFactoryBean(ResourcelessTransactionManager resourcelessTransactionManager) throws Exception {
          MapJobRepositoryFactoryBean factoryBean = new MapJobRepositoryFactoryBean(resourcelessTransactionManager);
          factoryBean.afterPropertiesSet();
          return factoryBean;
      }
  
      @Bean
      public JobRepository jobRepository(MapJobRepositoryFactoryBean factoryBean) throws Exception{
          return (JobRepository) factoryBean.getObject();
      }
  
      @Bean
      public SimpleJobLauncher jobLauncher(JobRepository jobRepository) {
          SimpleJobLauncher launcher = new SimpleJobLauncher();
          launcher.setJobRepository(jobRepository);
          return launcher;
      }
  
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>package com.abcplusd.application;
  
  import com.abcplusd.application.batch.Process;
  import com.abcplusd.application.batch.Reader;
  import com.abcplusd.application.batch.Writer;
  import org.springframework.batch.core.*;
  import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
  import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
  import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
  import org.springframework.batch.core.launch.support.RunIdIncrementer;
  import org.springframework.batch.core.launch.support.SimpleJobLauncher;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.context.annotation.Import;
  import org.springframework.scheduling.annotation.Scheduled;
  
  import java.util.Date;
  
  @Configuration
  @EnableBatchProcessing
  @Import({BatchScheduler.class})
  public class BatchConfig {
      @Autowired
      public JobBuilderFactory jobBuilderFactory;
  
      @Autowired
      public StepBuilderFactory stepBuilderFactory;
  
      @Autowired
      public SimpleJobLauncher jobLauncher;
  
      @Scheduled(cron = "0 0/1 * 1/1 * ?")
      public void sendSMSForBookMark() throws Exception {
          System.out.println(" Job Started at :"+ new Date());
          JobParameters param = new JobParametersBuilder().addString("JobID",
              String.valueOf(System.currentTimeMillis())).toJobParameters();
          JobExecution execution = jobLauncher.run(job(), param);
          System.out.println("Job finished with status :" + execution.getStatus());
      }
      public Job job() {
          return jobBuilderFactory.get("job")
              .incrementer(new RunIdIncrementer())
              .flow(step1())
              .end()
              .build();
      }
  
      public Step step1() {
          return stepBuilderFactory.get("step1")
              .&lt;String, String&gt; chunk(1)
              .reader(new Reader())
              .processor(new Process())
              .writer(new Writer())
              .build();
      }
  }
  </code></pre>
  
  <p>Help me to solve this issue.</p>