任何人都可以提供详细信息,了解如何通过提供需要的作业名称来实现“JobNameToJobRestartRequestAdapter”类API以重新启动失败的作业被执行。使用“org.springframework.batch.admin.integration.JobNameToJobRestartRequestAdapter”重新启动批量作业
我创建上下文xml文件
<int:channel id="job-launches" />
<int:channel id="job-restarts" />
<int:service-activator id="restartJobClassProperties" input-channel="job-restarts" output-channel="job-requests">
<bean class="org.springframework.batch.admin.integration.JobNameToJobRestartRequestAdapter">
<property name="jobLocator" ref="jobRegistry" />
<property name="jobExplorer" ref="jobExplorer" />
</bean>
</int:service-activator>
<bean id="jobRegistry" class="org.springframework.batch.core.configuration.JobLocator">
<property name="name" value="JobNameGoesHere" />
</bean>
<bean id="jobExplorer" class="org.springframework.batch.core.explore.JobExplorer" />
在执行其正在读我得到下面的错误该context.xml文件主类:
与名错误创建豆
'org.springframework.integration.config.ServiceActivatorFactoryBean#0': Cannot create inner bean 'org.springframework.batch.admin.integration.JobNameToJobRestartRequestAdapter#0' of type [org.springframework.batch.admin.integration.JobNameToJobRestartRequestAdapter] while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.batch.admin.integration.JobNameToJobRestartRequestAdapter#0' defined in class path resource [META-INF/spring/restart-job-context.xml]: Cannot resolve reference to bean 'jobRegistry' while setting bean property 'jobLocator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobRegistry' defined in class path resource [META-INF/spring/restart-job-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.batch.core.configuration.JobLocator]: Specified class is an interface
我想要实现用于定义批处理作业名称的功能,我希望重新启动它,并且可以从jobexplorer中提取属性最后执行的步骤。
感谢。细节,我仍然没有得到如何通过需要从最后一个失败的步骤重新启动的作业名称。 – 2014-10-22 20:28:53