I am trying to make use of the spring-retry library in my batch job and on adding the @EnableRetry
annotation to my @Configuration
as documentation suggests my application is now failing because it appears a spring-batch library bean which is being @Autowired
is being proxied.
@Configuration
@EnableBatchProcessing
@EnableRetry
@Import({SpringBatchConfiguration.class, School192ClientConfiguration.class })
public class SchoolJobConfiguration { .. }
Exception:
Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'jobRegistry' is expected to be of type 'org.springframework.batch.core.configuration.JobRegistry' but was actually of type 'com.sun.proxy.$Proxy130'
I have added the following to a separate class:
@Retryable(value = School192ClientException.class, maxAttempts = 3, backoff = @Backoff(delay = 2000))
@Override
protected void doReadPage() {
My question is why is this bean (jobRegistry
) being proxied? (I don't have much experience with AOP).
I am using spring-boot
version 1.5.3.RELEASE
.