Ibatis+Spring+webwork搭建框架所遇到的问题_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > Ibatis+Spring+webwork搭建框架所遇到的问题

Ibatis+Spring+webwork搭建框架所遇到的问题

 2011/12/29 17:28:09  xymtian  http://xymtian.iteye.com  我要评论(0)
  • 摘要:问题:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'userService'definedinclasspathresource[applicationContext-service-user.xml]:Invocationofinitmethodfailed;nestedexceptionisjava.lang.IllegalArgumentException
  • 标签:Web 问题 Spring
问题:
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="sqlMapClient" 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="sqlMapClient"/></property>
    </bean>
    <bean id="userService" class="com.tnt.ebr.sys.service.impl.UserServiceImpl">
<property name="dao" ref="baseDao"></property>
</bean>

IbatisBaseDao.java代码:
public class IbatisBaseDao extends SqlMapClientDaoSupport {
}
所要引用的代码:
public class UserServiceImpl extends SqlMapClientDaoSupport implements UserService {

protected IbatisBaseDao dao;


只要把extends SqlMapClientDaoSupport 去掉就OK了

问题待续中……
上一篇: java 泛型方法 下一篇: 再谈java调用dll
发表评论
用户名: 匿名