一个很菜的问题,困扰我很久了.在SpringSide3中配置ibatis,始终不成功,提示
[code="java"]Property 'sqlMapClient' is required[/code]
applicationContext.xml代码如下:
[code="xml"]
<context:component-scan base-package="jp.co.grids.mda" />
<!-- 数据源配置,在开发测试环境直连数据库 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@192.168.2.120:1521:MDA" />
<property name="username" value="MDA1" />
<property name="password" value="MDA" />
</bean>
<!-- 事务管理器配置,单数据源事务 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:/dao/sql-map-config.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- 默认的SqlMapClientTemplate -->
<bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
<property name="sqlMapClient" ref="sqlMapClient" />
</bean>
<bean id="entityDao" class="jp.co.grids.mda.base.EntityDao">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="sqlMapClient" ref="sqlMapClient" />
</bean>
[/code]
其中的EntityDao继承自GenericDao,GenericDao才继承自SqlMapClientDaoSupport.会不会是这个的问题?