配置mybatis错误总结
### The error may exist in SQL Mapper Configuration
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: Document root element "configuration", must match DOCTYPE root "mapper".
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:32)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:15)
at com.mybatis.test.UserTest.main(UserTest.java:20) 错误来源,连接池的配置里面错了

连接词对应的dtd文件是mybatis-3-config.dtd,如果你是直接复制了mybatis-3-mapper.dtd就会报错,改过来就行了
Exception in thread "main" org.apache.ibatis.datasource.DataSourceException: Error setting driver on UnpooledDataSource. Cause: java.lang.NullPointerException
at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.initializeDriver(UnpooledDataSource.java:179)
at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:57)
at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:349)
at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:55)
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:72)
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:32)
at com.mybatis.test.UserTest.main(UserTest.java:24)
错误来源:在连接池里面缺少驱动配置 <property name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
并且需要导入驱动包
### Error updating database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'addtime' in 'class com.entity.UsersEntity'
### The error may involve com.entity.Users.insert-Inline
### The error occurred while setting parameters
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'addtime' in 'class com.entity.UsersEntity' 错误原因:需要赋值的参数名称跟你的实体类名称需要对应
配置mybatis错误总结的更多相关文章
- 学习myBatis - 如何配置myBatis
这篇文章主要学习如何配置myBatis. 要学习新东西要讲究方法,要从三个层面去理解它:它是什么(what),为什么要学它(why),怎么用它(how).有了学习方法学习的效率才高. 1.myBati ...
- SpringBoot(十一):springboot2.0.2下配置mybatis generator环境,并自定义字段/getter/settetr注释
Mybatis Generator是供开发者在mybatis开发时,快速构建mapper xml,mapper类,model类的一个插件工具.它相对来说对开发者是有很大的帮助的,但是它也有不足之处,比 ...
- Spring Boot常见配置及错误
一.SpringBoot常见配置 (1)SpingBoot与MyBatis集成时跟踪SQL语句 log4j: logger: java: sql: ResultSet: TRACE (2)日志跟踪 d ...
- SpringBoot入门之基于Druid配置Mybatis多数据源
上一篇了解了Druid进行配置连接池的监控和慢sql处理,这篇了解下使用基于基于Druid配置Mybatis多数据源.SpringBoot默认配置数据库连接信息时只需设置url等属性信息就可以了,Sp ...
- spring boot配置mybatis和事务管理
spring boot配置mybatis和事务管理 一.spring boot与mybatis的配置 1.首先,spring boot 配置mybatis需要的全部依赖如下: <!-- Spri ...
- MyBatis学习(二):与Spring整合(非注解方式配置MyBatis)
搭建SpringMVC的-->传送门<-- 一.环境搭建: 目录结构: 引用的JAR包: 如果是Maven搭建的话,pom.xml的配置如下: <?xml version=" ...
- springmvc配置mybatis与hibernate的不同点
相信每个人对springmvc+hibernate或者springmvc+mybatis都不会陌生,拿来一个项目也都会开发.但是自己配置的情况下却很少,即使自己配置过,长时间不写也会忘,在这里记录一下 ...
- 原创:mysql5 还原至mysql 8.0.11数据库链接配置提示错误(修改内容有三处
原创:mysql5 还原至mysql 8.0.11数据库链接配置提示错误改有三: a) mysql 连接jar包版修改 b)类路径修改 c)配置连接池地址修改 因版本升级,首先要修改 1:mysql- ...
- MyBatis学习(一)、MyBatis简介与配置MyBatis+Spring+MySql
一.MyBatis简介与配置MyBatis+Spring+MySql 1.1MyBatis简介 MyBatis 是一个可以自定义SQL.存储过程和高级映射的持久层框架.MyBatis 摒除了大部分的J ...
随机推荐
- [Javascript] The Array filter method
One very common operation in programming is to iterate through an Array's contents, apply a test fun ...
- 通过blktrace, debugfs分析磁盘IO
前几天微博上有同学问我磁盘util达到了100%时程序性能下降的问题,由于信息实在有限,我也没有办法帮太大的忙,这篇blog只是想给他列一下在磁盘util很高的时候如何通过blktrace+debug ...
- careercup-排序和查找 11.2
11.2 编写一个方法,对字符串数组进行排序,将所有变位词1排在相邻的位置. 类似leetcode:Anagrams 解法: 变位词:由变换某个词或短语的字母顺序构成的新的词或短语.例如,“trian ...
- Using Sessions and Session Persistence---reference
Using Sessions and Session Persistence The following sections describe how to set up and use session ...
- Media Player框架
导入MediaPlayer.framework框架. //声明一个媒体播放器 var moviePlayer:MPMoviePlayerController? @IBAction func playM ...
- 关于字符串计算size的方法比较
往往字符串需要计算size来满足UI排版的自适应的需要,而一般字符串也是放在UILabel里的. 而在计算size的方法里,一般有两种方式(deprecated的就不说了). NSString的方法 ...
- Interesting visualization tools for profiling.
Interesting visualization tools for profiling. http://dtrace.org/blogs/brendan/2012/03/17/linux-kern ...
- start mysqld on Mac server
#!/bin/sh # Source the common setup functions for startup scripts test -r /etc/rc.common || exit 1 . ...
- Spring MVC中如何传递对象参数
springController: @Controller @RequestMapping("/user") public UserController extends BaseC ...
- JavaScript入门(3)
一.认识DOM 文档对象模型DOM(Document Object Model)定义访问和处理HTML文档的标准方法.DOM将HTML文档呈现为带有元素.属性和文本的树结构(节点树). Eg: 将HT ...