解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
来源:互联网 发布:爱知世博会logo涵义 编辑:程序博客网 时间:2024/05/16 11:39
我在MyEclipse中完整的可以运行的项目完整复制到idea中,运行却报
然后IDEA才会编译.xml文件。
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.gentlehu.diary.mapper.DiaryMapper.findDiaryById(id);
意思是没找到DiaryMapper的findDiaryById方法还有这个类的其他方法。
找了好久,发现在idea生成的classes中没有DiaryMapper.xml文件。
在MyEclipse中可以运行是因为MyEclipse中建立的是目录(src/main/java)的属性是资源目录,所以MyEclipse识别了这个属性会自动把这个目录的所有内容编译生成在classes中。
而在IDEA中目录是普通属性,所以它的(src/main/java)目录中的只有.java文件会默认编译,.xml文件不会被编译。
所以需要在maven的pom.xml中配置一下节点
<project> ...... <build> <resources><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes><filtering>true</filtering></resource></resources> </build></project>
然后IDEA才会编译.xml文件。
做个笔记,方便以后查阅。
0 0
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 安天发布《DDOS攻击之鬼影DDOS家族分析》
- MemCache
- Missing assembly: DevExpress.XtraPrinting.v11.2.
- CodeForces 213C Relay Race(dp)
- ST算法学习——POJ3264
- 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- quartz基础知识
- poj1094 Sorting It All Out (拓扑排序)
- Java的图片处理工具类ImageUtils
- du/df/ls
- Java内部类的小结
- Hbase安装kerberos及远程登录配置
- IntelliJ 创建main函数快捷
- HDU-4474