Spring使用Maven整合Mybatis问题总结
来源:互联网 发布:网络恐吓怎么解决 编辑:程序博客网 时间:2024/06/06 09:32
以下仅是个人遇到这些问题的解决办法,不一定适用于所有。
- Mybatis中出现映射文件目录是无效目录
<property name="mapperLocations" value="classpath:com/oaec/mapper/*.xml"></property>
当我们配置这个的时候,总是报com/oaec/mapper/*.xml是无效的目录,这个时候需要将该配置改成
<property name="mapperLocations" value="classpath*:com/oaec/mapper/*.xml"></property>
即可。
Invalid bound statement (not found) 无效的绑定错误
这个只有在使用maven的时候才会出现这个错误。
原因:因为maven没有打包xml文件,导致找不到xml文件。
解决办法:在pom.xml中添加配置
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*</include> </includes> </resource> </resources>
- 数据库连接错误
java.sql.SQLNonTransientConnectionException: Could not create connection to database server.java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
连接不上数据库,我这里是数据库驱动的版本错误,只需要改变版本即可。
阅读全文
0 0
- Spring使用Maven整合Mybatis问题总结
- SpringMvc+MyBatis+Spring+Maven整合遇到的问题总结
- maven+spring+mybatis整合
- Maven + Spring 整合 Mybatis
- MyBatis、Spring、maven整合
- spring+mybatis+maven整合
- Maven + Spring 整合 Mybatis
- maven+spring+spring+myBatis整合
- MyBatis使用总结和整合Spring
- 使用maven整合Spring,Spring mvc,mybatis框架
- Spring整合mybatis总结:
- spring整合mybatis总结
- mybatis整合spring使用MapperScannerConfigurer配置问题
- MAVEN+SPRING+MYBATIS整合常见问题
- MyBatis+Spring轻量级整合(Maven)
- SpringMvc+Spring+Mybatis+Maven整合
- spring springmvc mybatis maven整合
- Springmvc+spring+maven+Mybatis整合
- vue学习笔记[1] 开始
- Linux系统命令
- 16位伪指令汇编程序查看内存
- priority_queue 的用法
- 【java】基础
- Spring使用Maven整合Mybatis问题总结
- [转]DataGridView取消默认选中行
- Java面试题全集(下)
- 你现在还认为你过去用的框架好用么
- 服务机器人现在所面临的问题
- Android Studio trycatch快捷键
- 指针的算术运算(1) 加减运算
- SQLyog 查询数据并导出数据结果到excel
- 仿苹果手机通讯录字母固定在屏幕顶部的效果