idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

把myecipse中的项目搬迁到idea中的时候,发现报错

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

报错信息是:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

报错原因:idea构建gradle项目时不编译src/main/java目录下写的mapper.xml文件。

解决方案:

1,将dao包中的*mapper.xml剪切到src/main/resource下。

2,在ApplicationContext-dao.xml中加入

<property name="mapperLocations" value="classpath:*Mapper.xml"/>

如下图:

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

 这样子就配置好了mybatis中*mapper.xml的位置。

3,问题解决