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

 

posted @ 2016-11-21 09:36  一切随缘吧  阅读(15032)  评论(0编辑  收藏  举报