解决Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/cqupt/paging/dao/User.xml
搭建了一个ssm项目,启动报错Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/cqupt/paging/dao/User.xml
我看了一下路径没错,名字也没有写错
网上找了一下资料解决了,记录一下
我用maven管理,在target下并没有将User.xml,出错原因就是maven编译时没有将xml文件放进去,所以才会找不到User.xml文件
解决方法,在pom.xml加入:
<!--classpath-->
<build>
<!-- 定义classpath -->
<resources>
<!-- resources文件 -->
<resource>
<directory>src/main/resources</directory>
<!-- 是否被过滤,如果被过滤则无法使用 -->
<filtering>false</filtering>
</resource>
<!-- java文件夹 -->
<resource>
<directory>src/main/java</directory>
<!-- 引入映射文件等 -->
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
或者手动将User.xml放入targegt对应的路径下
解决Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/cqupt/paging/dao/User.xml的更多相关文章
- idea 下 启动maven项目,mybatis报错 Error parsing SQL Mapper Configuration. Cause: java.io.IOException。。。。。
我的具体报错日志是 Error parsing SQL Mapper Configuration. Cause: java.io.IOException Could not find resou ...
- ### Error building SqlSession. ### The error may exist in SQL Mapper Configuration ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibat
这是一个由粗心导致的错误,具体报错如下: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSessio ...
- ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.
在做多表映射查询时,在同一个resultMap中写了1:1映射和1:n映射,结果测试时报错如下: org.apache.ibatis.exceptions.PersistenceException: ...
- Error building SqlSession. ### The error may exist in dao/UserMapper.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration(2 字节的 UTF-8 序列的字节 2 无效。)
关于在学习Mybatis框架时运行报错 Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building ...
- The error may exist in com/bjpowernode/dao/StudentDao.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderExcept
The error may exist in com/bjpowernode/dao/StudentDao.xml### Cause: org.apache.ibatis.builder.Builde ...
- mybatis错误——java.io.IOException: Could not find resource com/xxx/xxxMapper.xml
在学习Mybatis的时候,参考网上的教程进行简单demo的搭建,配置的没有问题,然后出现了下面的错误! Exception in thread "main" java.lang. ...
- java.io.IOException: Could not find resource com/xxx/xxxMapper.xml
java.io.IOException: Could not find resource com/xxx/xxxMapper.xml 报错内容: org.apache.ibatis.exception ...
- java.io.IOException: Could not find resource SqlMapConfig.xml
java.io.IOException: Could not find resource SqlMapConfig.xml 创建mybatis工程时遇到的问题 问题的来源:当我们在项目中和src同级的 ...
- IDEA工具java.io.IOException: Could not find resource SqlMapConfig.xml
IDEA工具java.io.IOException: Could not find resource SqlMapConfig.xml 解决办法: 1.删掉pom.xml文件的这行代码 <pac ...
随机推荐
- JavaScript实现全屏显示
<!doctype html> <html> <head> <title>全屏显示</title> <meta charset=&qu ...
- Object类型的转为String类型
Map<String, Object> scaleMap = new HashMap(): scaleMap.put("name","张三"); S ...
- MVC输出缓存(OutputCache参数详解)
版权声明:本文为博主原创文章,未经博主允许转载随意. https://blog.csdn.net/kebi007/article/details/59199115 1.学习之前你应该知道这些 几乎每个 ...
- css的再深入7(更新中···)
1.transparent 透明的 2.placeholder 提示语 写页面 搞清结构层次, 保证模块化,让他们之间不能受到影响 (1) 元素性质 (2) 标准流 浮动带来的脱离文档流撑不起父级 ...
- centos7安装bbr
centos7安装bbr 安装 sudo wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.s ...
- 常见的Git命令
最近想着需要把工作中做一个备份,除了本地保存之外,上传到码云是个不错的选择,除了Git的一些特点外,也可以让别人看到你的代码,共同修改之类的 首先在上传到码云之前,需要学习Git的一些基础教程,包括国 ...
- docker-compose 手工指定容器IP
首先明确两点: 1只有自定义网络,才能手工指定每个容器的ip.默认的bridge是不行的! 2 手工设定了网段比如172.19.0.0 不影响docker在host装的网卡docker0 的172 ...
- angular面试记忆的内容
1.ng-class的用法:ng-class="{red:true}"; 2.ng-repeat怎么可以添加重复数据.ng-repeat="item in arr tra ...
- vs2010下使用sqlite
1.SQLite安装SQlite官网:http://www.sqlite.org/download.html 找到以下截图中内容 第一个解压之后是sqlite3.exe,第二个解压之后是sqlite3 ...
- Java集合框架源码分析(2)LinkedList
链表(LinkedList) 数组(array)和数组列表(ArrayList)都有一个重大的缺陷: 从数组的中间位置删除一个元素要付出很大的代价,因为数组中在被删除元素之后的所有元素都要向数组的前端 ...