欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

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

发布时间:2025/3/19 编程问答 24 豆豆
生活随笔 收集整理的这篇文章主要介绍了 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectU 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectUserByUname

解决思路:

1、先看注解是否都被扫描了 看mybatis-config 核心配置文件 是不是把mapper.xml的 映射路径写对拉。

2、看生成的target文件中 是否有 *mapper.xml 文件 maven 可能不会编译 *mapper.xml文件

可以在pom.xml 中的build 加入下列代码

<build><resources><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes><filtering>true</filtering></resource></resources> </build>

3、*mapper.java 文件和 *mapper.xml 文件是否同名 不同名字改成同样的名字

自言自语

慢慢修改bug 发现这些配置并不难,而是需要耐心去注意一些细节的处理。

总结

以上是生活随笔为你收集整理的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectU的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。