问题:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [applicationContext-service-user.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sqlMapClient is required
Caused by: java.lang.IllegalArgumentException: sqlMapClient is required
我的配置 :
<bean id="[b]sqlMapClient[/b]" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:sql-map-config.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="baseDao" class="com.tnt.ebr.sys.service.IbatisBaseDao">
<property name="sqlMapClient"><ref local="[b]sqlMapClient[/b]"/></property>
</bean>
<bean id="userService" class="com.tnt.ebr.sys.service.impl.UserServiceImpl">
<property name="dao" ref="[b]baseDao[/b]"></property>
</bean>
IbatisBaseDao.java代码:
public class IbatisBaseDao extends [b]SqlMapClientDaoSupport[/b] {
}
所要引用的代码:
public class UserServiceImpl [u][b]extends SqlMapClientDaoSupport [/b][/u]implements UserService {
protected IbatisBaseDao dao;
只要把extends SqlMapClientDaoSupport 去掉就OK了
问题待续中……
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [applicationContext-service-user.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sqlMapClient is required
Caused by: java.lang.IllegalArgumentException: sqlMapClient is required
我的配置 :
<bean id="[b]sqlMapClient[/b]" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:sql-map-config.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="baseDao" class="com.tnt.ebr.sys.service.IbatisBaseDao">
<property name="sqlMapClient"><ref local="[b]sqlMapClient[/b]"/></property>
</bean>
<bean id="userService" class="com.tnt.ebr.sys.service.impl.UserServiceImpl">
<property name="dao" ref="[b]baseDao[/b]"></property>
</bean>
IbatisBaseDao.java代码:
public class IbatisBaseDao extends [b]SqlMapClientDaoSupport[/b] {
}
所要引用的代码:
public class UserServiceImpl [u][b]extends SqlMapClientDaoSupport [/b][/u]implements UserService {
protected IbatisBaseDao dao;
只要把extends SqlMapClientDaoSupport 去掉就OK了
问题待续中……