title: Spring batch -Run JobLauncher
body: <p>i integrated Spring Batch in my project and i have problem in running JobLauncher.</p>
  
  <p>in my class JobLauncher i have this :</p>
  
  <pre><code>  public class XXXJobLauncher {
  @Autowired
  @Qualifier("testJob")
  Job testJob;
  
  @Autowired
  JobLauncher jobLauncher;
  
  @ServiceActivator
  public void run(FileMetaData fileMetaData) {
      ///
  
      JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
      jobParametersBuilder.addString("uuiid", fileMetaData.getUuid());
      jobParametersBuilder.addLong("id", dataImport.getId());
  
      try {
          jobLauncher.run(testJob, jobParametersBuilder.toJobParameters());
      } catch (JobExecutionAlreadyRunningException | JobRestartException | JobParametersInvalidException | JobInstanceAlreadyCompleteException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>for configuration i use XML Config :</p>
  
  <p>ConfigBatch.xml:</p>
  
  <pre><code>     &lt;import resource="classpath:job-config.xml"/&gt;
  
  &lt;bean id="jobRepositoryFactory" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;property name="tablePrefix" value="BATCH_"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="jobRepository" class="org.springframework.batch.core.repository.support.SimpleJobRepository"
        factory-bean="jobRepositoryFactory"/&gt;
  
  &lt;bean id="batchTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"
        destroy-method="shutdown"&gt;
      &lt;property name="corePoolSize" value="6"/&gt;
      &lt;property name="allowCoreThreadTimeOut" value="true"/&gt;
      &lt;property name="waitForTasksToCompleteOnShutdown" value="true"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"&gt;
      &lt;property name="jobRepository" ref="jobRepository"/&gt;
      &lt;property name="taskExecutor" ref="batchTaskExecutor"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>in job-Config.xml i have :</p>
  
  <pre><code>   &lt;batch:job id="testJob"
             incrementer="incrementer"
             job-repository="jobRepository"&gt;
      &lt;batch:step id="Step1"&gt;
          &lt;batch:tasklet throttle-limit="4"
                         transaction-manager="transactionManager"
                         task-executor="batchTaskExecutor"&gt;
              &lt;batch:chunk reader="XXXReader"
                           processor="passThroughItemProcessor"
                           writer="XXXWriter"
                           skip-limit="100"
                           commit-interval="10"&gt;
                  &lt;batch:skippable-exception-classes&gt;
                      &lt;batch:include class="org.springframework.batch.item.file.FlatFileParseException"/&gt;
                  &lt;/batch:skippable-exception-classes&gt;
                  &lt;batch:listeners&gt;
                      &lt;batch:listener ref="XXXListener"/&gt;
                  &lt;/batch:listeners&gt;
              &lt;/batch:chunk&gt;
          &lt;/batch:tasklet&gt;
      &lt;/batch:step&gt;
  &lt;/batch:job&gt;
  
  &lt;bean id="XXXReader"
        class="com.reader.XXXReader"
        scope="step"&gt;
      &lt;constructor-arg value="#{jobParameters[uuiid]}" name="uuiid"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="XXXWriter"
        class="com.writer.XXXWriter"
        scope="step"&gt;
      &lt;constructor-arg value="#{jobParameters[ id]}" name="id"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="XXXListener"
        class="com.listener.XXXListener"&gt;
  &lt;/bean&gt;
  
  &lt;bean id="passThroughItemProcessor" class="org.springframework.batch.item.support.PassThroughItemProcessor"/&gt;
  
  &lt;bean id="incrementer" class="org.springframework.batch.core.launch.support.RunIdIncrementer"/&gt;
  </code></pre>
  
  <p>when i debug in class JobLauncher it stop in jobLuancher.run and i have no exception it's seems like spring batch doesn't recognizes the reader and whriter !!is there any suggestion?</p>