I have the configuration like below:
batch:job id="reconciliationJob" job-repository="jobRepository" restartable="true"
and during application context startup I receive something like this in the log:
[INFO] [] [] Overriding bean definition for bean 'reconciliationJob': replacing [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] with [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]
How can I solve this overriding problem?
I got the same error. My problem was that I marked the class with @Service
then in one of the @Configuration
classes I created a @Bean
out of it with the same name as the class.
This happens when Spring parses the same applicationContext.xml
twice.
This can happen when for example your have duplicate/overriding <context-param>
imports in your WEB.xml
.
To solve the issue leave only the root applicationContext.xml
there and remove the children.
This is not an error, is only an [INFO] and is a substitution done by Spring; you can see something similar about "step" scoped beans.
For example, if you have a bean marked as
<bean id="myBean" class="path.to.beanClass" scope="step" />
this will be replaced by a bean with name scopedTarget.myBean
.
Lookup at StepScope doc and source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With