解决Caused by: org.apache.ibatis.exceptions.PersistenceException:
2024-10-19 09:02:13
在mybatis-config核心配置文件中注册了xml以后出现了新的异常错误
Caused by: java.io.IOException: Could not find resource cn.dzp.dao.UserMapper.xml
经过检查发现了我所用的项目乃是maven构建的
maven由于它的约定大于配置,可能会导致我写的配置文件无法被导出或者生效的问题,解决方法就是在pom.xml里面添加以下代码
<build>
<resources>
<resource>
<directory>src/main/resources/</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource> </resources>
</build>
这下子运行正常,成功解救问题
最新文章
- LintCode Edit Distance
- 线程优先级抢占实验【RT-Thread学习笔记 3】
- 删除已经配置的类库和移除CocoaPods[转]
- Shell脚本的追踪与debug
- asp.net下ajax.ajaxMethod使用方法(转)
- Unity3d 一些 常见路径
- sqlserver 2008 R2 分区表测试
- A题笔记(3)
- 使用JavaScript扫描端口
- Sql server 事务 存储过程
- (Jquery)避免数据相加小数点后产生多位数和计算精度损失
- devexpress设置系统全局字体(含工具栏字体)
- Pollard-rho算法学习笔记
- oracle学习笔记第三天
- apt-get update 出现错误“ AppStream cache update completed, but some metadata was ignored due to errors. ”
- 不得不补:PHP的JSON, SQL
- 用git,clone依赖的库
- Nordic Collegiate Programming Contest NCPC 2017-Problem D-Distinctive Character
- 如何获取select选中的值
- linux nat style