We are having batch.xml which has imports of all the job xmls and beans which are related to the job. When i use normal way of loading i don't see any issues. But if i use AutomaticJobRegistrar I am getting object un-initialized exception.
Because in spring xml the beans are having init-method
<bean id="employee" class="org.test.Employee"
init-method="init" />
Normal way of loading
AutomaticJobRegistrarCode:<bean id="jobLoader" class="java.lang.String" />
What is the issue? How the context is initialized?Code:<bean id="jobLoader" class="org.springframework.batch.core.configuration.support.AutomaticJobRegistrar"> <property name="applicationContextFactories"> <bean class="org.springframework.batch.core.configuration.support.ClasspathXmlApplicationContextsFactoryBean"> <property name="resources" value="classpath*:/META-INF/spring/batch/jobs/**/*.xml" /> </bean> </property> <property name="jobLoader"> <bean class="org.springframework.batch.core.configuration.support.DefaultJobLoader"> <property name="jobRegistry" ref="jobRegistry" /> </bean> </property> </bean> <bean class="org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor" p:jobRegistry-ref="jobRegistry"/>
What is the order of spring context loader?
Thanks in Advance...


Reply With Quote