版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cg_Amaz1ng/article/details/82733481
出现上述错误,就要考虑使用@Primary或者@Qualifier注解的使用了。
@Qualifier注解的使用:
1、可以加到方法的参数上,如
public Job CSVJob(@Qualifier("userStep1")Step step){
return jobBuilderFactory.get("csvJob")
.incrementer(new RunIdIncrementer())
.flow(step)
.end()
.listener(csvJobListener())
.build();
`
表明,CSVJob将会使用名称为 userStep1 的step。
2、(未完待续)