用iBATIS的DAO写了个东西
新增一个表的CRUD实现后,出现了以下的问题:
Exception in thread "main" com.ibatis.dao.client.DaoException: There is no DAO implementation found for class com.ccutsesms.mis.dao.impl.BDM in any context. If you've registered multiple implementations of this DAO, you must specify the Context ID for the DAO implementationyou're looking for using the getDao(Class iface, String contextId) method.
at com.ibatis.dao.engine.impl.StandardDaoManager.getDao(StandardDaoManager.java:64)
at com.ccutsesms.mis.service.BDMService.getBDM(BDMService.java:20)
at com.ccutsesms.mis.util.BDMTag.getTags(BDMTag.java:21)
at test.com.ccutsesms.mis.util.TestTags.main(TestTags.java:19)
我的实现如下:
DAO Interface:
com.ccutsesms.mis.dao.IBDM;
DAO implement:
com.ccutsesms.mis.dao.impl.BDM;
DAO configure file:
<daoConfig>
<context>
<transactionManager type="SQLMAP">
<property name="SqlMapConfigResource"
value="com/ccutsesms/mis/maps/SqlMapConfig.xml"/>
</transactionManager>
... ...
<dao interface="com.ccutsesms.mis.dao.IBDM"
implementation="com.ccutsesms.mis.dao.impl.BDM"/>
... ...
</context>
</daoConfig>
DAO service:
public class BDMService {
static DaoManager daoManager = DaoConfig.getDaoManager();
public List<BDMDto> getBDM(String bdm_type) {
IBDM bdm = (IBDM) daoManager.getDao(BDM.class);
... ...
后来发现是这里写错了
IBDM bdm = (IBDM) daoManager.getDao(BDM.class);
应为
IBDM bdm = (IBDM) daoManager.getDao(IBDM.class);
真是一不小心疏忽了,可能其他人做的时候一样容易疏忽吧。写出来,警记!!!
分享到:
相关推荐
碰见这样的问题先鄙视下提供例子的作者, 再声讨下struts2,为什么要在框架里面加载一个死的struts.xml,难得不能想struts1 一样的在web.xml里面配置吗? 看网上都催struts2比struts1 整的整的好,我看就这个问题...
之前一直找原因,最后知道了解决方法,具体请下载源码查看。特别是用到throw的事务中
HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit..doc
Show Message When There is No Disk in a Drive
Visual Studio打开Qt项目时“there's no Qt version assigned to this project for platform win32”问题的解决方法1
今天小编就为大家分享一篇关于Mybatis单个参数的if判断报异常There is no getter for property named 'xxx' in 'class java.lang.Integer'的解决方案,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,...
在使用sublime下载扩展包的过程中,通过ctrl+shift+p打开包管理菜单界面,输入install 选中Install Package并回车,出现There are no packages available for installation的提示,导致安装插件出现问题,解决方案...
解决sublime text3使用Install Package时发生There are no packages available for installation问题。直接在Preferences->Package Setting->Package Control ->Setting User 中设置: { "bootstrapped": true, ...
我选择SAP CAP项目的db文件夹,右键选择build时,遇到如下... Can not create service instance ‘Products-Products-db-hdi-container8HPfzrS/PBqVvnsD’: There is no database available. Ensure that you have a
其中一个问题是报but there is no HDFS_NAMENODE_USER defined. Aborting operation. Starting datanodes 直接解决 在Hadoop安装目录下找到sbin文件夹 在里面修改四个文件 1、对于start-dfs.sh和stop-dfs.sh文件,...
解决Sublime包管理package control 报错 There are no packages available for installation: 修改hosts没有用。ctrl + ` 打开命令行可以看到出错信息。 【解决方案】: 1.下载channel_v3.json文件,直接放到本地...
解决docker报错There are no more lookback devices available
主要介绍了使用Mybatis遇到的there is no getter异常,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
最近使用sublime text 3通过Package Control:Install Package时突然打不开,出现There are no packages available for installation问题。只需要打开首选项->插件设置->Package Control->Settings-Default,把...
Sublime安装package control时报错"there are no pacages avaliable for installaiton"-附件资源
NULL 博文链接:https://elfasd.iteye.com/blog/1908001
1、CANoe连接VT System; 2、VT6000实时系统; 3、VT System板卡使用; 4、VT System故障排查;
there is no file description
pegasis for matlab code there is no problem to run this code is good and eatlabish code for matlab
Important: Before you install this package please make sure there is no ODAC/Oracle Universal Installer (OUI) version of Oracle Developer Tools for Visual Studio installed on the machine. If there is ...