I try to create a job as so (using spring-batch 2.1.7.RELEASE and spring 3.0.5.RELEASE):
In this project the ApplicationContext does not allow beans to be overidden so AllowBeanDefinitionOverriding is false (i can't change this). This doesn't work as i get the exception:Code:<batch:job id="someJob" job-repository="jobRepository"> <batch:step id="aStep"> <batch:tasklet> <batch:chunk reader="itemReader" writer="itemWriter" commit-interval="5"/> </batch:tasklet> </batch:step> </batch:job>
in org.springframework.beans.factory.support.DefaultL istableBeanFactory, line 460.Code:org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Invalid bean definition with name 'someJob' defined in null: Cannot register bean definition [Generic bean: class [org.springframework.batch.core.configuration.xml.JobParserJobFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'someJob': There is already [Generic bean: class [org.springframework.batch.core.configuration.xml.SimpleFlowFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
It seems that the JobParser first registers a bean with id 'someJob' with a bean definition SimpleFlowFactoryBean and then tries to override it with a JobParserJobFactoryBean.
Has anyone seen this or is there a way around it?
Thanks,


Reply With Quote
