Question: I recently update my spring boot app 2.1.9 to 2.2.0 and i'm facing a problem. When i'm calling "configprops" from actuator endpoint, an exception is throw :
Scope 'job' is not active for the current thread

I reproduce the bug : <https://github.com/guillaumeyan/bugspringbatch> (just launch the test). Original project come from <https://github.com/spring-guides/gs-batch-processing/tree/master/complete>

I tried to add :

```java
  @Bean
  public StepScope stepScope() {
    final StepScope stepScope = new StepScope();
    stepScope.setAutoProxy(true);
    return stepScope;
  }

```

but it does not work (with spring.main.allow-bean-definition-overriding=true)

Here is my configuration of the spring batch

```
  @Bean
  @JobScope
  public RepositoryItemReader<DossierEntity> dossierToDiagnosticReader(PagingAndSortingRepository<DossierEntity, Long> dossierJpaRepository, @Value("#{jobParameters[origin]}") String origin) {
    RepositoryItemReader<DossierEntity> diagnosticDossierReader = new RepositoryItemReader<>();
    diagnosticDossierReader.setRepository(dossierJpaRepository);
    diagnosticDossierReader.setMethodName("listForBatch");
    // doing some stuff with origin
    return diagnosticDossierReader;
  }

```

```java
ExceptionHandlerExceptionResolver[199] - Resolved [org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'scopedTarget.dossierToDiagnosticReader': Scope 'job' is not active for the current thread; 
consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No context holder available for job scope]

```

Answer: 
I downloaded your project and was able to reproduce the case. There are two issues with your example:

* You are defining a job scoped bean in your app but the `JobScope` is not defined in your context (and you are not using `@EnableBatchProcessing` annotation that adds it automatically to the context). If you want to use the job scope without `@EnableBatchProcessing`, you need to add it manually to the context.
* Your test fails because there is no job running during your test. Job scoped beans are lazily instantiated when a job is actually run. Since your test does not start a job, the bean is not able to be proxied correctly.

Your test does not seem to test a batch job, I would exclude the job scoped bean from the test's context.
Bug resolve in spring boot 2.2.1 <https://github.com/spring-projects/spring-boot/issues/18714>