任何人都可以提供詳細信息,瞭解如何通過提供需要的作業名稱來實現「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