Invalid bound statement (not found) 异常原因
2016-10-17 18:36
615 查看
mybatis报错如下:
原因如下:
1、没有加载mapper文件:<mappers>
<mapper resource="mappers/CaptchaMapper.xml" />
</mappers>
2、接口路径问题:
3、没有映射:
4、DAO层方法名和xml中的id不同
5、返回类型resultMap在xml中未声明
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):
原因如下:
1、没有加载mapper文件:<mappers>
<mapper resource="mappers/CaptchaMapper.xml" />
</mappers>
2、接口路径问题:
<!-- 这里namespace必须是接口的路径,不然要运行的时候要报错 “is not known to the MapperRegistry”--> <mapper namespace="com.zc.beauty.dao.ICaptchaMapper">
3、没有映射:
<bean id="CaptchaMapper" class="org.mybatis.spring.mapper.MapperFactoryBean" > <property name="sqlSessionFactory" ref="SqlSessionFactory" /> <property name="mapperInterface" value="com.zc.beauty.dao.ICaptchaMapper" /> </bean>
4、DAO层方法名和xml中的id不同
<!-- 这里的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>
5、返回类型resultMap在xml中未声明
<resultMap id="RecsortChnResultMap" type="com.caissa.erp.caissafip.domain.basic.recsortchnconfig.po.RecsortChnConfigVo" > <id column="DBID" property="dbid" jdbcType="CHAR" /> <result column="FK_RECCHN_DBID" property="fkRecchnDbid" jdbcType="CHAR" /> <result column="UPDATEDEPTNAME" property="updatedeptname" jdbcType="VARCHAR" /> </resultMap> <select id="selectChnRectypeByConfigDbid" resultMap="ChnRectypeResultMap" parameterType="java.lang.String"> SELECT CRR.DBID, recsort.RECSORTNAME, chn.CHNNAME, rectype.RECTYPENAME,CRR.FK_CONFIG_DBID,CRR.FK_RECTYPE_DBID,rcconfig.FK_RECCHN_DBID,rcconfig.FK_RECSORT_DBID,rcconfig.ISRECEIVABLE,rcconfig.RECEIVABLECOMPANYCODE,rcconfig.RECEIVABLECOMPANYNAME FROM FI_BS_CHN_RECTYPE_REF CRR LEFT JOIN FI_BS_RECSORT_CHN_CONFIG rcconfig on CRR.FK_CONFIG_DBID = rcconfig.dbid left join FI_DC_RECEIVESORT recsort on recsort.dbid = rcconfig.FK_RECSORT_DBID and recsort.delflag = '1' left join FI_BS_CHN chn on chn.dbid = rcconfig.FK_RECCHN_DBID and chn.delflag = '1' left join FI_DC_RECEIVETYPE rectype on rectype.dbid = crr.FK_RECTYPE_DBID and rectype.delflag = '1' WHERE RCCONFIG.DELFLAG = '1' AND CRR.DELFLAG = '1' AND RCCONFIG.DBID = #{fkConfigDbid, jdbcType=VARCHAR} </select>
相关文章推荐
- springboot 集成mybatis Invalid bound statement (not found)异常
- springboot 集成mybatis Invalid bound statement (not found)异常
- Invalid bound statement (not found)错误的可能原因
- Invalid bound statement (not found)错误的可能原因
- Invalid bound statement (not found): com.bookestore.dao.OrderInfoDao.findList的根本原因及解决方案
- Invalid bound statement (not found): 异常
- Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample: 错误
- Invalid bound statement(not found)
- 困扰了我一个下午的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.zhiyou100.video.mapper.SpeakerMapper.speakerTotalCount
- Invalid bound statement (not found): com.shizongger.chapter2.mapper.UserMapper.insertUser 解决方案
- Invalid bound statement (not found)
- Invalid bound statement (not found)
- Invalid bound statement (not found)
- Invalid bound statement (not found)
- Invalid bound statement (not found)错误
- Mybatis Invalid bound statement (not found)问题分析
- mybatis invalid bound statement (not found) : com.XXXX