Spring Batch - java.util.concurrent.ExecutionException:没有可用于作业范围的上下文持有者

时间:2016-08-03 13:03:18

标签: spring spring-batch

我正在写一份春季批处理作业。作业从数据库读取,进行一些处理,然后写入文件。

它可以在没有分区步骤的情况下运行单线程。到现在为止还挺好。

我现在想要增强作业以添加分区程序并从由特定列中的值分区的数据库中读取行。

这是我到目前为止的代码......

http://pastebin.com/wwSjrNhv

当我尝试执行它时,我收到以下错误。

java.util.concurrent.ExecutionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.readStgDbAndExportMasterListStep': Scope 'job' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No context holder available for job scope

这里可以看到完整的错误......

http://pastebin.com/jyARDH51

有人可以协助我理解作业的哪些部分需要在步骤范围内,以及作业的哪些部分需要定义为JobScope,特别是在我的用例中我试图多线程我的工作以便帮我解决这个问题?

感谢

0 个答案:

没有答案
相关问题