org.apache.ibatis.binding.BindingException: Invalid bound statement Mybatis绑定错误问题解决

萌新哭泣的问题,问题出现于,在复制了一个module之后,各种改名,不小心改动的xml相关的配置。原因就是对于mybatis-spring项目 其中的配置文件不是很清楚。

<mapper namespace="com.vdian.vitamin.test.qacommon.persistence.NodeInfoMapper">

mapper文件夹下的对应do文件的xml里的namespace一定包名全路径
<select id="queryNodeInfoByGroupIdAndServiceIdAndNodeKey"   ID对应的方法也要一致对应

第二个检查点项目中的DBconfig的xml文件中除了对databasesource的配置外,注意有以下两个配置
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">    <property name="basePackage" value="com.**.persistence" />        presistence 下就是具体的mapper类 用于扫描发现项目中的mapper接口类</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">    <property name="dataSource" ref="dataSource" />    <property name="configLocation" value="classpath:mybatis-config.xml" />    <property name="typeAliasesPackage" value="com.***.dao" />    <property name="mapperLocations" value="classpath:mapper/*.xml" />     特别是这里 寻找第一个检查mapperxml文件</bean>

这样项目中Mybatis就能正确绑定数据资源和项目中的数据操作方法




原文地址:https://www.cnblogs.com/xierunfang/p/11657451.html

时间: 2024-07-31 21:37:06

org.apache.ibatis.binding.BindingException: Invalid bound statement Mybatis绑定错误问题解决的相关文章

解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误

我调这个bug调了一天多,在网上搜索的检查namespace,package等,都没有错.错误提示是没有找到xml文件,我就纳闷了,为什么找不到呢?后来才发现,原来是resource中奇怪的目录为题,可以看着两个链接:https://jingyan.baidu.com/article/93f9803f51225fe0e56f5573.html,https://blog.csdn.net/benben513624/article/details/81076182. 在创建resources下目录时

通过maven test 报org.apache.ibatis.binding.BindingException: Invalid bound statement

背景 直接使用eclipse工具去执行,没有问题,通过testng.xml去执行,没有问题,但通过mvn clean test执行,就报错,提示org.apache.ibatis.binding.BindingException: Invalid bound statement 解决方法 首先先肯定的是:mybatis的配置是没有问题,因为eclipse可以正常执行: 在eclipse中把mapper的xml文件放到src代码目录下是可以一起打包进classes的,而maven去编译的时候不会,

Exception:HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

主要错误信息如下: HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.RuntimeException: org

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): da.huying.usermanage.mapper.UserMapper.queryUserById    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:196)    at org.apache.ibatis.bindi

MyBatis笔记----报错:Exception in thread &quot;main&quot; org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法

报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectarticle at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:230) at or

IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

有时候解决问题不仅仅是解决问题.-----jstarseven 最近因为开发需要,需要搭建一个ssm开发框架,采用了开发工具IDEA. 整合完了SSM开发框架之后,发布的时候出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found... 一开始以为是自己配置文件写的有问题找了半天也没有问题,之后才发现是自己对IDEA工具使用的不够熟悉. 先说该异常常见解决方案: 一般是xml映射文件有错误.但

MyBatis笔记----报错Exception in thread &quot;main&quot; org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser

信息: Refreshing org[email protected]41cf53f9: startup date [Wed Apr 05 16:48:12 CST 2017]; root of context hierarchy 四月 05, 2017 4:48:12 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definiti

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.baway.dao.UserMapper.register

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.baway.dao.UserMapper.register    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)    at org.apache.ibatis.binding.MapperMethod.<

spring boot 整合mybatis:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

最近在学习SpringBoot,遇到些异常情况: 1.异常信息 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.hippo.demo.dao.Chapter6DemoMapper.insert 2.解决方案 问题找了很久,发现使用@Select.@Insert.@Update.@Delete注解代替xxxMapper.xml里面的内容,不存在异常,那就是扫描xxxMapper