zoukankan      html  css  js  c++  java
  • Srping mvc mabatis 报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

    我的Mapper采用接口+注解的方式注入

    @Repository(value="customerServOutCallMapper")
    public interface CustomerServOutCallMapper {
        public int batchInsertMap(List<Map<String,Object>> list);
    }

    配置文件采用.xml

    问题的本质是从接口的方法映射到要执行的sql时失败了,原因通常是配置文件有误:

    1.spring配置文件错误,spring的mabatis配置文件中

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
            <property name="dataSource" ref="dataSource" />
            <property name="configLocation" value="classpath:mybatis/mybatis-config.xml" />
            <property name="mapperLocations">
                <list>
                    <value>classpath*:mybatis/mapper/*Mapper.xml</value>
                </list>
            </property>
        </bean>

    红色的这一行最好配全路径,我的问题就是这个原因(这是在另一个项目不配全路径也没问题,还没搞明白)

    2.mapper.xml文件
    <mapper namespace="com.xxxx.data.customerserv.outcall.dao.CustomerServOutCallMapper">

    namespace是dao所在报名+类名

  • 相关阅读:
    通过git向github提交项目
    git连接github mac
    char如何储存3个字节或者4个字节
    centOS 7安装jdk
    在移动端语言react中使用video.js
    小程序自定义头部navbar组件
    git常用指令汇总学习
    react表单
    react从入门到熟悉(回顾react)
    react生命周期
  • 原文地址:https://www.cnblogs.com/cupsuccess/p/6084336.html
Copyright © 2011-2022 走看看