最近在用Maven架SSM测试项目的时候遇到一个坑,一切配置正确的情况下通过mybatis访问数据库的时候报错如下:
严重: Servlet.service() for servlet [web] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.guli.mapper.UserMapper.getUserById] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.guli.mapper.UserMapper.getUserById
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
at com.sun.proxy.$Proxy31.getUserById(Unknown Source)
at com.guli.service.impl.UserServiceImpl.getUserById(UserServiceImpl.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke