首页 > 其他 > 详细

在idea中mybatis错误(1)

时间:2016-11-06 13:59:41      阅读:275      评论:0      收藏:0      [点我收藏+]
错误提示为:

### Error building SqlSession.
### The error may exist in cn/qd/mybatis/map/productMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource cn/qd/mybatis/map/productMapper.xml

问题:在全局配置文件Configure.xml

<mappers>
<mapper resource="cn/qd/mybatis/map/productMapper.xml"/>
</mappers>
无法找到资源的路径,在idea中貌似无法识别productMapper.xml

问题解决:既然找不到.xml文件,那么就在maven编译时将.xml文件放进去。即:在pom.xml文件的<build>标签中,加入
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>

原文出自:http://blog.csdn.net/witsmakemen/article/details/46913425

在idea中mybatis错误(1)

原文:http://www.cnblogs.com/Zhouya/p/6034912.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!