mybatis 的使用过程中提示错误: 
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.msunsoft.mapper.HisLisReportMapper.getMaxMtcData

含义:HisLisReportMapper的getMtcData方法没有找到或者没有绑定

背景: 
1.HisLisReportSyncWorker 控制类中

String hospitalCode = ConfigRead.getValue("config.properties",
"HOSPITAL_CODE");
List<Integer> updateIdList = new ArrayList<>();
HisLisReportService hisLisReportService = (HisLisReportService) DataVisitorHolder
.getVisitorMap().get("hisLisReportService");
HashMap<Object, Object> maxHisLisReportMap = hisLisReportService
.getMaxMtcData(hospitalCode);
HashMap<Object, Object> map = hisLisReportService
.getMaxChangeVersion(hospitalCode);

HisLisReportServiceImpl

@Override
@DataSource(name="blSql35")
public HashMap<Object, Object> getMaxChangeVersion(String hospitalCode)
throws Exception {
// TODO Auto-generated method stub
return hisLisReportMapper.getMaxChangeVersion(hospitalCode);
}

HisLisReportMapper 代码

@Override
public HashMap<Object, Object> getMaxChangeVersion(String hospitalCode)
throws Exception ;

HisLisReportService 代码

@Override
public HashMap<Object, Object> getMaxChangeVersion(String hospitalCode)
throws Exception ;

Mybatis.xml文件

 <select id="getMaxChangeVersion" parameterType="java.lang.String" resultType="java.util.HashMap">
select
max(sys_change_version) as MAXVERSION ,max(etl_id) as MAXID from
ETL.DBO.ETL_CHARGE_RECORD where hospital_code=#{hospitalCode} and etl_table='lismain.lisdata.report_main'
</select> <select id="getMaxMtcData" parameterType="java.lang.String" resultType="java.util.HashMap">
select max(his_lis_report_id) as MAXID from his_lis_report where hospital_code=#{hospital_code}
</select>

错误处理流程: 
我这里使用的SSM,spingMvc ,mybatis ,maven来构建项目,项目中使用了HisLisReportSyncWorker的控制类,HisLisReportServiceImpl代码实现,HisLisReportService接口类,HisLisReportMapper 的mapper类以及HisLisReportMapper.xml配置文件

1.检查实现类中方法是否存在

2。检查Service类的这个方法是否存在

3.检查Mapper类的这个方法

4.对应的mybatis 的配置文件是否存在,里面数据是否配置正确

5.检查Mapper类是否被加载了

这个错误主要是因为在config的配置文件中没有加载这个xml文件

mybatis 异常处理:Invalid bound statement (not found)的更多相关文章

  1. mybatis:Invalid bound statement (not found)

    [常规解决办法] 如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因 ...

  2. MyBatis错误--Invalid bound statement (not found)

    今天在开发项目的时候使用MyBatis发生错误:Invalid bound statement (not found) 具体错误信息: org.springframework.beans.factor ...

  3. mybatis错误Invalid bound statement (not found) 的解决办法

    <!-- IDEA需要添加一下内容,否则无法找到mapper --> <build> <resources> <resource> <direct ...

  4. mybatis 报Invalid bound statement(not found) 和 Property 'mapperLocations' was not specified or not matching resources found

    排除问题的步骤: 1.首先检查mapper文件和mapper接口的文件名是否相等. 2.pom.xml是否把xml排除了,这样写就会src/main/java下所有的Mybatis的xml文件都删除, ...

  5. myBatis中Invalid bound statement (not found)错误

    环境:Idea.ssm.maven 由于使用maven的原因,maven不会扫描到mapper的xml文件所以会出现此类问题. 每次走到mapper方法时就抛异常:Invalid bound stat ...

  6. 解决Mybatis的invalid bound statement (not found)异常

    使用Maven构建SSM时, 需要在pom.xml中配置一些信息, 否则mapper.xml就无法被扫描到, 程序就会抛invalid bound statement (not found)异常 解决 ...

  7. 关于 Mybatis 的Invalid bound statement (not found):错误

    今天遇到一个特别奇怪的问题,最后发现是自己对mybatis的学习还有待提高 返回类型可以用resultType,也可以用resultMap resultType是直接表示返回类型的,而resultMa ...

  8. mybatis BindingException: Invalid bound statement (not found)

    错误截图 解决措施 此异常的原因是由于mapper接口编译后在同一个目录下没有找到mapper映射文件而出现的. 通常我们在配置SqlSessionFactory时会有如配置 <!-- 配置Sq ...

  9. mybatis报Invalid bound statement (not found) 分析

      解决问题的步骤,请参考: 1.mapper.xml要和对应的mapper接口在同一个包下,包名要一模一样. 2.Mapper接口中的方法在Mapper.xml中没有,然后执行Mapper接口的方法 ...

  10. idea的spring整合基于xml文件配置的mybatis报Invalid bound statement (not found): com.music.dao.MusicDao.findAll的问题

    一. 题主当时就是自己尝试整合spring和mybatis的时候遇到了这个问题,当时题主只看到了用注解的方式配置的dao层,题主用的是xml文件配置的形式, 而且坑爹的是题主的两个文件的路径写的也不一 ...

随机推荐

  1. 【转】eclipse中window->preference选项中没有tomcat的解决方法

    eclipse中window->preference选项中没有tomcat的解决方法 2011-09-09 13:46:35|  分类: eclipse|字号 订阅 其实一共有好几种方法,这只是 ...

  2. 【转】如何在eclipse下配置Heritrix

    如何配置在eclipse下配置Heritrix 在其他帖子上看到有Eclipse 配置 Heritrix 1.14.4的文章,这里有很多内容是引用自那里.如http://extjs2.javaeye. ...

  3. 【linux安装软件步骤】

    一.解析linux应用软件安装包: 通常Linux应用软件的安装包有三种: tar包,如software-1.2.3-1.tar.gz.它是使用UNIX系统的打包工具tar打包的. rpm包,如sof ...

  4. SqlDataReader

    using (mycon) { //using语句与try catch finally结合使用 mycon.Open(); // MessageBox.Show("dakai"); ...

  5. C习题练习

    #define _CRT_SECURE_NO_WARNINGS#include <stdio.h> //比较俩个数的大小 //int max(int a, int b) {// int t ...

  6. 【Java】ServiceLoader源码分析

    ServiceLoader主要的功能是用来完成对SPI的provider的加载. 先看下它的成员: public final class ServiceLoader<S> implemen ...

  7. Linux ifconfig-etho文件参数详解

    1.ifcfg-eth0文件参数详解 DEVICE 网卡名称/网络接口的名称BOOTPROTO 系统启动地址协议 常用参数: none:不使用启动地址协议,none禁止DHCP bootp:BOOTP ...

  8. 洛谷P3803 【模板】多项式乘法(FFT)

    P3803 [模板]多项式乘法(FFT) 题目背景 这是一道FFT模板题 题目描述 给定一个n次多项式F(x),和一个m次多项式G(x). 请求出F(x)和G(x)的卷积. 输入输出格式 输入格式: ...

  9. 在Eclipse中使用Maven创建Web工程

    在Eclipse中使用Maven创建Web工程 1.创建maven Project工程,使用maven-archetype-webapp 2.在pom.xml文件中,设置打包类型为war <pa ...

  10. 前端页面使用ace插件优化脚本

    html页面:<pre id="editor" style="width: 100%;height: 800px;"></pre>(注: ...