当前位置: 代码迷 >> SQL >> java.lang.IllegalArgumentException: No SqlMapClient specified错误解决方案
  详细解决方案

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

热度:244   发布时间:2016-05-05 13:54:04.0
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注入的名字

  相关解决方案