I am using the spring-batch-admin-sample application as the starting point for a project. I have a working spring-batch job that is built with annotations that I am integrating with the console.
When I jar it up and add it to my console project, the annotations are not honored. In order to test this, I have gone as far as to add the tag to the job, so an attempt to build the job bean means that the annotation-config tag has been seen and processed.
Can anyone see what I am missing?
Thanks in advance.
Environment
OS: Windows 7
Java: jdk 1.8.0_25
Spring Batch Admin Sample version: 1.3.1
Spring version: 3.2.13 * stock 3.2.9 has a bug that causes this symptom
Spring-batch version: 3.0.2
Pivotal tc version: 3.0 Developer Edition
IDE: STS 3.6.3
Log Snip:
14:27:13.667 [localhost-startStop-1] WARN ... Error creating bean with name 'step0002-fetch':
**Cannot resolve reference to bean 'sourceSelectionReader'**
while setting bean property 'itemReader'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException:
No bean named 'sourceSelectionReader' is defined
Job Bean Definition
<context:annotation-config/>
<bean class="org.springframework.batch.core.scope.StepScope" />
<batch:job id="my-job">
<batch:step id="step0002-fetch" >
<batch:tasklet transaction-manager="transactionManager" start-limit="100" >
<batch:chunk reader="sourceSelectionReader" writer="selectedDataWriter" commit-interval="1" />
</batch:tasklet>
<batch:next on="*" to="step0003-archive-purge"/>
</batch:step>
</batch:job
Class definition:
@Component("sourceSelectionReader")
@Scope(value="step", proxyMode = ScopedProxyMode.INTERFACES)
public class SourceSelectionReaderImpl
implements ItemReader<Object>,SourceSelectionReader, ApplicationContextAware {
...
}