[mybatis] mybatis错误:Invalid bound statement (not found)
点击菜单抛出异常:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.misscandy.inter.UserMapper.findAllUsers
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
1.保证spring,mybatis 的集成环境oK.
<!-- 扫描myBatis映射文件 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSourcePolice" />
<property name="mapperLocations"
value="classpath*:com/casic/police/persistence/mybatis/*.xml" />
</bean>
<!-- 扫描myBatis的Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage"
value="com.casic.police.persistence.mapper" />
</bean>
2.maven 环境下,可能因为 *Mapper.xml 文件没有编译的原因.
在pom.xml的build节点下配置:
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
重新编译,部署,正常。
[mybatis] mybatis错误:Invalid bound statement (not found)的更多相关文章
- MyBatis绑定错误[Invalid bound statement (not found)]
如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper i ...
- 解决Mybatis 报错Invalid bound statement (not found)
解决Mybatis 报错Invalid bound statement (not found) 出现此错误的原因 1.xml文件不存在 2.xml文件和mapper没有映射上 namespace指定映 ...
- MyBatis错误--Invalid bound statement (not found)
今天在开发项目的时候使用MyBatis发生错误:Invalid bound statement (not found) 具体错误信息: org.springframework.beans.factor ...
- mybatis错误Invalid bound statement (not found) 的解决办法
<!-- IDEA需要添加一下内容,否则无法找到mapper --> <build> <resources> <resource> <direct ...
- mybatis 异常处理:Invalid bound statement (not found)
mybatis 的使用过程中提示错误: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): ...
- 使用Mybatis时报错Invalid bound statement (not found):
使用逆向工程时生成的.xml文件在conf目录下,而使用查询方法时,无法在dao包下找到xml文件,所以报错. 测试代码如下所示: @Test public void testSimple() thr ...
- MyBatis笔记:invalid bound statement (not found)
maven项目在本地运行的时候没有问题,一旦把war包部署到测试机上就不能运行.查看了一下tomcat日志发现抛出这样的错误:invalid bound statement (not found),后 ...
- springboot+mybatis报错Invalid bound statement (not found)
今天做项目时报了一个错提示说Invalid bound statement (not found),也就是说mapper接口绑定.xml文件出错了,找不到指定的sql:原因是程序没有把.xml文件编译 ...
- [MyBatis]诡异的Invalid bound statement (not found)错误
转自:https://blog.csdn.net/z69183787/article/details/48933481 自从开始使用Maven管理项目,最近在配置MyBatis的Mapper,在Ecl ...
- Mybatis配置问题解决Invalid bound statement (not found)
首先这个异常的原因是系统根据Mapper类的方法名找不到对应的映射文件. 网上也搜索了到了类似的文章,一般可以从以下几个点排查: mapper.xml的namespace要写所映射接口的全称类名,而且 ...
随机推荐
- SQL float 保留两位小数
1. SQL 数据库里类型改为numeric,小数位设置成22. 在SQL语句中转换:select convert(字段,numeric(18,2)) AS 字段3. 在DataFormatStrin ...
- [转]在Windows中配置Rsync同步
在Windows中配置Rsync同步 Rsync是一款不错的文件免费同步软件,可以镜像保存整个目录树和文件系统,同 时保持原来文件的权限.时间.软硬链接.第一次同步时 rsync 会复制全部内容,下次 ...
- magento数据库备份导入还原
Magento数据库备份.移植终极解决方案+3 分类:Magento教程 标签:magento搬家.magento数据库备份.magento更换域名.magento移植 4,355人浏览 作为电子商务 ...
- 动画(Animation) 、 高级动画(Core Animation)
1 演示UIImage制作的动画 1.1 问题 UIImage动画是IOS提供的最基本的动画,通常用于制作一些小型的动画,本案例使用UIImage制作一个小狗跑动的动画,如图-1所示: 图-1 1.2 ...
- 脚本语言&& Performance Testing
watin: http://www.cnblogs.com/dahuzizyd/archive/2007/04/13/ruby_on_rails_windows_instatnrails_study_ ...
- 《深入浅出Node.js》第3章 异步I/O
@by Ruth92(转载请注明出处) 第3章 异步I/O Node 的基调:异步 I/O.事件驱动.单线程. Node 不再是一个服务器,而是一个可以基于它构建各种高速.可伸缩网络应用的平台. No ...
- dede的pagelist标签的listsize数字属性详解(借鉴)
dede的pagelist标签的listsize数字属性详解.见远seo经常用织梦搭建各种网站,有次发现列表页面的分页显示超过div的界限,也就是溢出了或者说是撑破了.后来经过研究发现是pagelis ...
- Debian 安装下载工具软件
Debian 安装下载工具软件 1.下载BT种子Torrent文件 Linux下载种子文件肯定不能使用迅雷了,推荐一款叫做qBittorrent的P2P下载软件,目前在Ubuntu中使用很广泛,同样D ...
- JAVA基础总结一:
一.数据类型及变量名和注释 1. Java 中的数据类型分为两大类: 1) 原生数据类型 (Primitive Data Type) :8个(byte.char.short.int.long.floa ...
- install kinect driver for ARM---38
原创博客:转载请标明出处:http://www.cnblogs.com/zxouxuewei/ The video describes connecting a Microsoft Kinect to ...