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所在报名+类名

  • 相关阅读:
    动态内存开辟(一)
    结构体,联合体,枚举,typedef
    练习使用C++的string类
    WIN10 + Qt 5.14(MSVC 2017,32bit) + APP项目(minGW-7.3.0 32bit)+glog
    扫雷游戏
    最小栈实现
    快速排序算法
    c++语句(循环)
    C++ 存储类
    C++ 运算符
  • 原文地址:https://www.cnblogs.com/cupsuccess/p/6084336.html
Copyright © 2011-2022 走看看