title: Camel route with Spring Batch: No JobLauncher
body: <p>I'm deploying a Spring Batch job triggered by a Camel route. Here is the Spring Batch config:</p>
  <pre><code>@Configuration
  @EnableBatchProcessing
  public class JobConfig
  {
      ...
  
      @Bean(name = &quot;personJob&quot;)
      public Job personJob(JobCompletionNotificationListener personListener, Step personStep)
      {
          return jobBuilderFactory
            .get(...)
            .incrementer(new RunIdIncrementer())
            .listener(...)
            .flow(...)
            .end()
            .build();
      }
      ...
  </code></pre>
  <p>The Camel route looks like this:</p>
  <pre><code>@ApplicationScoped
  public class MyRouteBuilder extends RouteBuilder
  {
      @Override
      public void configure() throws Exception
      {
        from(&quot;file://...&quot;)
        ...
        .to(&quot;spring-batch:personJob?jobLauncherRef=jobLauncher&quot;);
  }
  </code></pre>
  <p>Running the route above raises the following exception:</p>
  <pre><code>[ERROR]     Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: spring-batch://personJob?jobLauncherRef=jobLauncher due to: No JobLauncher named jobLauncher found in the registry.
  [ERROR]     Caused by: java.lang.IllegalStateException: No JobLauncher named jobLauncher found in the registry.&quot;}}}}    
  </code></pre>
  <p>However, the documentation clearly states:</p>
  <blockquote>
  <p>The @EnableBatchProcessing works similarly to the other @Enable*
  annotations in the Spring family. In this case, @EnableBatchProcessing
  provides a base configuration for building batch jobs. Within this
  base configuration, an instance of StepScope is created in addition to
  a number of beans made available to be autowired:</p>
  <pre><code>JobRepository: bean name &quot;jobRepository&quot;
  
  JobLauncher: bean name &quot;jobLauncher&quot;
  ...
  </code></pre>
  </blockquote>
  <p>So, there should be a bean named &quot;jobLauncher&quot; of the type JobLauncher. Why isn't it found in the registry ?</p>
  <p>Many thanks in advance,</p>
  <p>Seymour</p>