springMVC4.0+mybatis Invalid bound statement (not found)
严重:Servlet.service()forservlet[springmvc]incontextwithpath[/viat]threwexception[Reque...
严重: Servlet.service() for servlet [springmvc] in context with path [/viat] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.viat.dao.AdminuserinfoMapper.selectByPrimaryKey] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.viat.dao.AdminuserinfoMapper.selectByPrimaryKey
检查mapper.xml 与配置文件xml 没发现错误。求救 展开
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.viat.dao.AdminuserinfoMapper.selectByPrimaryKey
检查mapper.xml 与配置文件xml 没发现错误。求救 展开
2个回答
展开全部
我也遇到这个问题,我的是springboot+ibatis,你有没有用maven,找到一种和maven有关的情况,我也是在网上看到了,刚解决:
异常:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xwq.project.dao.ClothesDao.queryList
原因:编译默认只把src/main/下的java文件编译后放进target/classes里,而ibatis的mapper.xml文件则没有搬运过去,所以导致程序运行到Dao层找不到对应方法
解决:在pom.xml里的<build><resources></resources></build>加入以下内容
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
感谢:网页链接第6楼的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询