首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

java.lang.IllegalArgumentException: No SqlMapClient specified错误解决方案

2012-09-15 
java.lang.IllegalArgumentException: No SqlMapClient specified异常解决方案原因是在创建DAO对象时使用

java.lang.IllegalArgumentException: No SqlMapClient specified异常解决方案


原因是在创建DAO对象时使用了 new xxxDaoImpl()的方法,直接使用注解或配置方式取对应的bean即可

如下:

WebApplicationContext beanFactory = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);        WriterLogDaowriterLogDao = (WriterLogDao) beanFactory.getBean("writerLogDao");

?或
?

   /**     * 短信发送日志DAO     */    @Resource(name = "mobile12580.WriterLogDao")    private WriterLogDao writerLogDao;

?

"mobile12580.WriterLogDao"为WriterLogDaoImpl注入的名字

热点排行