在執行我的工作,我得到異常下面沒有定義命名爲「springbatch.readerDataSource」豆
無法解析參考豆「springbatch.readerDataSource」而設置的bean屬性「數據源」;嵌套的例外是org.springframework.beans.factory.NoSuchBeanDefinitionException:沒有名爲 'springbatch.readerDataSource' 豆在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference定義 (BeanDefinitionValueResolver.java:329)
注 - 我沒有創建單獨的閱讀器文件。只需使用JdbcCursorItemReader。
我的配置文件
<bean id="itemReader"
class="org.springframework.batch.item.database.JdbcCursorItemReader" scope="step">
<property name="dataSource" ref="springbatch.batchDataSource"/>
<property name="sql"
value=
"select Cust_Id from Customer "/>
<property name="rowMapper">
<bean class="com.insurance.premiumrecalculation.batch.CustDto" />
</property>
</bean>
<bean id="policy.premium.recalculation.PremiumRecalculationWriter"
class="com.insurance.premiumrecalculation.batch.PremiumRecalculationProcessWriter" scope="step"/>
<batch:job id="policy.job.premiumRecalculation"
job-repository="springbatch.jobRepository" parent="springbatch.job.baseJob">
<batch:step id="policy.step.premiumrecalculation" parent="springbatch.step.baseStep">
<batch:tasklet allow-start-if-complete="false" transaction-manager="powTransactionManager">
<batch:chunk commit-interval="10"
reader="itemReader"
writer="policy.premium.recalculation.PremiumRecalculationWriter"/>
</batch:tasklet>
</batch:step>
</batch:job>
在此先感謝
在我的Spring配置文件「springbatch.batchDataSource」已cofigured。還有我的XML我使用springbatch.batchDataSource但投擲「springbatch.readerDataSource」例外。 – Smita 2013-02-18 06:01:28