I am using Spring Batch 2.1.5.RELEASE and I am having a problem with ClassPathXmlApplicationFactory. It seems that it does not like wildcards in the resource path. The following config will not work:
However, the following config does work. Notice the path above should find the path below.HTML Code:<bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" /> <bean id="jobContextFactory" class="org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextFactory"> <property name="resource" value="classpath*:META-INF/spring/batch/jobs/**/*.xml"/> </bean> <bean id="jobLoader" class="org.springframework.batch.core.configuration.support.DefaultJobLoader"> <property name="jobRegistry" ref="jobRegistry" /> </bean> <bean id="jobRegistrar" class="org.springframework.batch.core.configuration.support.AutomaticJobRegistrar"> <property name="applicationContextFactories" ref="jobContextFactory"/> <property name="jobLoader" ref="jobLoader"/> </bean>
Am I missing something?HTML Code:<bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" /> <bean id="jobContextFactory" class="org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextFactory"> <property name="resource" value="classpath:META-INF/spring/batch/jobs/jobserviceimpl/jobserviceimpl-job-context.xml"/> </bean> <bean id="jobLoader" class="org.springframework.batch.core.configuration.support.DefaultJobLoader"> <property name="jobRegistry" ref="jobRegistry" /> </bean> <bean id="jobRegistrar" class="org.springframework.batch.core.configuration.support.AutomaticJobRegistrar"> <property name="applicationContextFactories" ref="jobContextFactory"/> <property name="jobLoader" ref="jobLoader"/> </bean>


Reply With Quote