报Invalid bound statement (not found)

来源:6-9 用户模块所有功能自测试

wryu

2017-08-22

测试login.do的时候报这个错

HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mmall.dao.UserMapper.checkUsername


type Exception report

message Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mmall.dao.UserMapper.checkUsername

description The server encountered an internal error that prevented it from fulfilling this request.


exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mmall.dao.UserMapper.checkUsername
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:943)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
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:108)




写回答

2回答

wryu

提问者

2017-08-23

发现applicationContext-datasource.xml中的sqlSessionFactory的mapperLocations的value为classpath*:mappers/ShippingMapper.xml,改为classpath*:mappers/*Mapper.xml可以解决问题

3
0

看你笑呵呵

2017-08-23

下次发问题代码要贴的全一点,最好把mapper上的这个方法也贴出来 = =

1.问题的话看看你的mapper.xml文件是不是在resources下面,如果不是放在resources下面试试

2.看看checkUsername有没有和dao层的方法对应上

3.检查mapper是否存在问题

0
0

从0开始 独立完成企业级Java电商网站服务端开发

前后端分离,数据库接口设计,架构设计,功能开发,上线运维

9476 学习 · 8804 问题

查看课程