没配置流

没有配置流今天用到一个配置,我当时没有注册进入两个流,?运行的时候,发现这个错误?org.springframework.ba

没有配置流

今天用到一个配置,我当时没有注册进入两个流,

?

运行的时候,发现这个错误

?

org.springframework.batch.item.WriterNotOpenException: Writer must be open before it can be written to

?

Converted from a single FlatFileItemWriter to a database and flatfileitemwriter and didn't register the flatfile one as a stream.

If using a single FlatFileItemWriter it is enough to register it as an ItemWriter however when using the composite the adding it as a stream is also needed.

?

所以必须配置

?

<chunk reader="heterogeneousItemReader" writer="reterogeneousItemWriter"

commit-interval="1" >

<streams>

? ? ? ? ? ? ? ? ? ? ? ?<stream ref="studentwriter" />

? ? ? ? ? ? ? ? ? ? ? ?<stream ref="goodswriter" />

? ? ? ? ? ? ? ? ? ? </streams>

</chunk>