java.lang.IllegalArgumentException: No SqlMapClient specified
2014-07-11 16:27
1936 查看
java.lang.IllegalArgumentException: No SqlMapClient specified
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:166)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296)
at com.raycloud.dao.impl.ItemCheckTaskDaoImpl.queryItemCheckTask(ItemCheckTaskDaoImpl.java:66)
at com.raycloud.thread.ItemCheckThread.run(ItemCheckThread.java:57)
at java.lang.Thread.run(Thread.java:619)
在做spring + ibatis整合时,容易报此类异常
原因是在创建DAO对象时使用了 new xxxDaoImpl()的方法,应该用使用
WebApplicationContext beanFactory = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
ItemCheckTaskDao itemCheckTaskDao = (ItemCheckTaskDao) beanFactory.getBean("itemCheckTaskDao");
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:166)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296)
at com.raycloud.dao.impl.ItemCheckTaskDaoImpl.queryItemCheckTask(ItemCheckTaskDaoImpl.java:66)
at com.raycloud.thread.ItemCheckThread.run(ItemCheckThread.java:57)
at java.lang.Thread.run(Thread.java:619)
在做spring + ibatis整合时,容易报此类异常
原因是在创建DAO对象时使用了 new xxxDaoImpl()的方法,应该用使用
WebApplicationContext beanFactory = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
ItemCheckTaskDao itemCheckTaskDao = (ItemCheckTaskDao) beanFactory.getBean("itemCheckTaskDao");
相关文章推荐
- java.lang.IllegalArgumentException:No SqlMapClient specified
- java.lang.IllegalArgumentException: No bean specified
- java.lang.IllegalArgumentException: No SqlMapClient specified 异常解决方案
- java.lang.IllegalArgumentException: No SqlMapClient specified 异常解决方案
- java.lang.IllegalArgumentException: No bean specified
- java.lang.IllegalArgumentException: No destination bean specified
- java.lang.IllegalArgumentException: No origin bean specified解决方法
- java.lang.IllegalArgumentException: No bean specified
- java.lang.IllegalArgumentException: No bean specified
- struts1.x 错误之 java.lang.IllegalArgumentException: No bean specified
- java.lang.IllegalArgumentException: Property 'sqlMapClient' is required
- 出现java.lang.IllegalArgumentException: No configs match configSpec
- Mybatis异常-java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.type.JdbcType.NUMBE
- Spring AOP - Caused by: java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
- java.lang.IllegalArgumentException: No file 'file
- 错误:java.lang.illegalArgumentException:No view id found for fragment
- Spring AOP - Caused by: java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
- java.lang.IllegalArgumentException:No view found for id for fragment 的解决
- java.lang.IllegalArgumentException: No view found for id
- java.lang.IllegalArgumentException: No view found for id 0x7f090003 for fragment MainFg{40d57e28 #0