org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.e3mall.search.ma

错误信息如下:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.e3mall.search.ma

问题原因:就是Mybtais项目中xxxMapper.java文件与xxxMapper.xml文件在项目编译后不在同一个目录下.

解决办法:

方法一:在org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.e3mall.search.ma目录下创建一个与xxxMapper.java相同的目录,将xxxMapper.xml放入其中,重新编译运行.

方法二:在项目的pom.xml文件中配置:

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>