亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

定義 Bean 時沒有合格的 Bean

定義 Bean 時沒有合格的 Bean

收到一只叮咚 2021-12-22 15:33:54
我一直在嘗試進行設置,在其中創建實現 JdbcCursorItemReader 的 PostDatedAchInReader,然后將其注入 PostDatedAchInAggregatingJdbcItemReader,后者根據特定條件收集讀取對象并將它們分組到一個列表中,基本上按客戶端 ID 保留所有 ach 請求組。但是,我不斷收到沒有合格的 bean 錯誤,但 bean 在這里并已定義。我很困惑問題是什么或如何解決它。所以我有以下配置文件@Configurationpublic class PostDatedAchInBatchConfig extends AbstractCommonBatchJobConfig {    private static final String ACH_FULFILLMENT_POST_DATED_ACH_IN_STEP1_NAME =            "achFulfillment_postDatedAchInJob_step1_scheduleAchIns";    @Autowired    DataSource prodDataSource;    /**     * This method defines the Job.     *     * @return postdatedachinjob     *         return the configured job.     */    @Bean(name = "achFulfillmentPostDatedAchInJob")    public Job job() throws Exception {        mmLogMgr.info("AchFulfillmentEmailBatchConfig : job");        return getJobBuilderFactory().get("achFulfillmentPostDatedAchInJob")                .listener(postDatedAchInListener())                .start(step1())                .on(ExitStatus.COMPLETED.getExitCode())                .end() // end of TransactionBuilder                .end() // end of FlowBuilder                .build();    }..    /**     * @return postDatedAchInAggregatingJdbcItemReader.     */    @Bean    @Scope(value = "step", proxyMode = ScopedProxyMode.DEFAULT)    public ItemReader<ArrayList<PostDatedAchIn>> postDatedAchInAggregatingJdbcItemReader(@Qualifier("postDatedAchInReader") final PostDatedAchInReader postDatedAchInReader)            throws Exception {        PostDatedAchInAggregatingJdbcItemReader postDatedAchInAggregatingJdbcItemReader =                new PostDatedAchInAggregatingJdbcItemReader();        postDatedAchInAggregatingJdbcItemReader.setDatabaseItemReader(postDatedAchInReader);        return postDatedAchInAggregatingJdbcItemReader;    }我很困惑它如何說它在類中定義時找不到該類型的 bean。我怎樣才能解決這個問題?
查看完整描述

1 回答

?
慕虎7371278

TA貢獻1802條經驗 獲得超4個贊

因此,我們能夠通過在步驟配置中更改對聚合讀取器的調用以發送游標讀取器的方法/bean 來解決此問題。我們改變了這一行:

.reader(postDatedAchInAggregatingJdbcItemReader(postDatedAchInReader()))

并刪除了@Qualifier。這停止了這個錯誤,它確實正確地連接了所有東西。對我來說感覺有點笨重,但它有效。如果有人有其他解決方案,我愿意接受其他解決方案。


查看完整回答
反對 回復 2021-12-22
  • 1 回答
  • 0 關注
  • 197 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號