您的位置:首页 > 运维架构 > Apache

Exception:Request processing failed; nested exception is org.apache.ibatis.binding.BindingException

2017-07-21 17:04 786 查看


Exception:Request processing failed; nested exception
is org.apache.ibatis.binding.BindingException

分类:异常处理

 (5052)  (4)


异常

在测试Spring MVC+Mybatis整合时,运行 Maven build -> tomcat7:Run 遇到如下异常



从异常信息上看,是找不到mapper对应的xml文件,于是我到target目录去查找,是否存在mapper对应的xml文件,发现xml 文件并不在target目录下




解决方案

修改easybuy-manager-mapper的pom文件



在Pom文件添加如下内容:

[html] view
plain copy

<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->  

    <build>  

        <resources>  

            <resource>  

                <directory>src/main/java</directory>  

                <includes>  

                    <include>**/*.properties</include>  

                    <include>**/*.xml</include>  

                </includes>  

                <filtering>false</filtering>  

            </resource>  

        </resources>  

    </build>  

这样就可以让Maven build字节码时把资源文件也一起生成.

原文作者 http://blog.csdn.net/Evan_Leung/article/details/50670780
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐