Mybatis 报错

builder.BuilderException: Error parsing SQL Mapper Configuration

Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/xxx/dao/UserDao.xml

这个原因是我的 resources 文件下面的 package 不能建立,因此我将其标记为 test resources,问题解决

It's likely that neither a Result Type nor a Result Map was specified

这个原因是:Mybatis配置文件中没有返回类型参数

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException 是文件查询之后不知道将结果集封装到哪里

因此在查询的方法id后面添加一个resultType,

将结果封装至User

InvalidConnectionAttributeException

还有一个关于时区的问题,此问题为时区问题,在 JDBC 的连接 url 部分加上 serverTimezone=UTC 即可。

如果选择utc会比中国时间早8个小时,如果在中国,可以选择Asia/Shanghai或者Asia/Hongkong

UTC 即 Universal Time Coordinated 世界标准时间

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.

解决方法:

<property name="url" value="jdbc:mysql://localhost:3306/dbMybatis?serverTimezone=UTC"/>

Mybatis 报错的更多相关文章

  1. mybatis报错Mapped Statements collection does not contain value for com.inter.IOper

    首页 > 精品文库 > mybatis报错Mapped Statements collection does not contain value for com.inter.IOper m ...

  2. mybatis报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types () or values ()

    mybatis报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types ...

  3. mybatis报错:Invalid bound statement (not found)

    mybatis报错:Invalid bound statement (not found)的原因很多,但是正如报错提示一样,找不到xml中的sql语句,报错的情况分为三种: 第一种:语法错误 Java ...

  4. oracle+mybatis报错:BindingException("Invalid bound statement (not found): ")

    oracle+mybatis报错:BindingException("Invalid bound statement (not found): ") 从mysql转到oracle数 ...

  5. Springboot项目下mybatis报错:Invalid bound statement (not found)

    mybatis报错:Invalid bound statement (not found)的原因很多,但是正如报错提示一样,找不到xml中的sql语句,报错的情况分为三种: 第一种:语法错误 Java ...

  6. mybatis报错:A query was run and no Result Maps were found for the Mapped Statement、、Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]问题解决

    今天在做ssm项目的时候出现了: 先是出现 了错误: mybatis报错:A query was run and no Result Maps were found for the Mapped St ...

  7. Mybatis报错:Could not find resource mybatis-conf.xml

    Mybatis报错:Could not find resource mybatis-conf.xml 报错截图: 报错内容: java.io.IOException: Could not find r ...

  8. 解决Mybatis 报错Invalid bound statement (not found)

    解决Mybatis 报错Invalid bound statement (not found) 出现此错误的原因 1.xml文件不存在 2.xml文件和mapper没有映射上 namespace指定映 ...

  9. mybatis 报错Result Maps collection does not contain value for java.lang.Integer

    重点:报错的方法和xml文件不一定是错误的位置,如果有多个xml文件,必须检查所有的文件 搜索  resultMap="java.lang.Integer" 找到对应的文件,改为  ...

随机推荐

  1. java中PipedStream管道流通信详细使用(详解)

    多线程使用PipedStream 通讯 Java 提供了四个相关的管道流,我们可以使用其在多线程进行数据传递,其分别是 类名 作用 备注 PipedInputStream 字节管道输入流 字节流 Pi ...

  2. Java实现 洛谷 P1000 超级玛丽游戏

    public class Main { public static void main(String[] args){ System.out.println(" ********" ...

  3. mysql基础之-mysql查询缓存(九)

    0x01 MySQL查询缓存 用于保存MySQL查询语句返回的完整结果,被命中时,MySQL会立即返回结果,省去解析.优化和执行等操作 如何检查缓存?? MySQL保存结果与缓存中: 把select语 ...

  4. 深入剖析AQS

    目录 摘要 AbstractQueuedSynchronizer实现一把锁 ReentrantLock ReentrantLock的特点 Synchronized的基础用法 ReentrantLock ...

  5. MongoDB知识点总结

    一:MongoDB 概述    一.NoSQL 简介 1. 概念:NoSQL(Not Only SQL的缩写),指的是非关系型数据库,是对不同于传统的关系型数据库的数据库管理系统的统称.用于超大规模数 ...

  6. laravel clone后需要做的操作

    首先 安装依赖关系 composer install 第二步 复制配置文件 cp .env.example .env 第三步 创建新的应用程序密钥 php artisan key:generate 第 ...

  7. [NOI Online #3]魔法值

    题目   点这里看题目. 分析   我们不难想到,对于系数进行一下的拆分: \[\begin{aligned} f(u,j)&=\bigoplus_{(u,v)\in E} f(v,j-1)\ ...

  8. @atcoder - ARC077F@ SS

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 规定一个字符串为 "偶串" 当且仅当它可以表 ...

  9. mysql日期和时间类型

    TIME 类型 TIME 类型用于只需要时间信息的值,在存储时需要 3 个字节.格式为 HH:MM:SS.HH 表示小时,MM 表示分钟,SS 表示秒. TIME 类型的取值范围为 -838:59:5 ...

  10. Redis在CentOS for LInux上安装详细教程

    1.首先上传安装包,这里我以 redis-5.0.8.tar.gz 为例子. Linux下载redis地址:wget http://download.redis.io/releases/redis-5 ...