Invalid bound statement (not found)
2017-10-17 17:25
453 查看
Invalid bound statement (not found)
mybatismybatis报如下错误:
[plain]
view plain
copy
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [dispatcherServlet] in context with path [/zc-beauty2]
threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
com.zc.beauty.dao.ICaptchaMapper.savePhoneCode] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zc.beauty.dao.ICaptchaMapper.savePhoneCode
错误之处可能有以下几个:
1、没有加载mapper文件:
[html]
view plain
copy
<mappers>
<mapper resource="mappers/CaptchaMapper.xml" />
</mappers>
2、接口路径写错了:
[html]
view plain
copy
<!-- 这里namespace必须是接口的路径,不然要运行的时候要报错 “is not known to the MapperRegistry”-->
<mapper namespace="com.zc.beauty.dao.ICaptchaMapper">
3、方法名写错了:
[html]
view plain
copy
<!-- 这里的id必须和接口中的方法名相同,不然运行的时候也要报错 -->
<insert id="savePhoneCode" parameterType="com.zc.beauty.model.PhoneCaptcha">
insert into phone_captcha(u_phone, c_phonecode, c_sendtime) values(#{u_phone}, #{c_phonecode}, #{c_sendtime})
</insert>
4、没有 <!-- 数据映射器类 mapper bean -->
[html]
view plain
copy
<bean id="CaptchaMapper" class="org.mybatis.spring.mapper.MapperFactoryBean" >
<property name="sqlSessionFactory" ref="SqlSessionFactory" />
<property name="mapperInterface" value="com.zc.beauty.dao.ICaptchaMapper" />
</bean>
相关文章推荐
- Invalid bound statement (not found)
- Invalid bound statement (not found): com.shizongger.chapter2.mapper.UserMapper.insertUser
- Invalid bound statement (not found)
- Invalid bound statement (not found): com.shizongger.chapter2.mapper.UserMapper.insertUser 解决方案
- Invalid bound statement (not found): com.zhiyou100.video.mapper.SpeakerMapper.speakerTotalCount
- Maven项目mybatis Invalid bound statement (not found)解决方法
- 困扰了我一个下午的Invalid bound statement (not found)
- invalid bound statement (not found)
- Invalid bound statement (not found): xxx.xxxx.method解决办法
- Invalid bound statement (not found) 问题处理
- Invalid bound statement (not found)
- Invalid bound statement (not found)
- invalid bound statement (not found)
- springboot 集成mybatis Invalid bound statement (not found)异常
- Invalid bound statement (not found)错误的可能原因
- Invalid bound statement (not found)
- Spring Boot mybaties error Invalid bound statement (not found)
- springboot 集成mybatis Invalid bound statement (not found)异常
- Invalid bound statement (not found)-Mybatis在idea中错误
- Invalid bound statement (not found): com.bookestore.dao.OrderInfoDao.findList的根本原因及解决方案