Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:

线程“main”org.apache.ibatis.exceptions.PersistenceException中的异常:

今天学习mybatis时运行程序报了如题错误,网上有说是没加时区的问题,也有说是驱动问题。我改了改了mybatis的版本,仍旧是同一错误,不是mybatis的问题,之后我把mysql驱动改成之前下载的版本,可以成功运行,但显示如下警告

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

意思是:加载类 'com.mysql.jdbc.Driver'.这已弃用。新的驱动程序类是“com.mysql.cj.jdbc.Driver”。驱动程序通过 SPI 自动注册,通常不需要手动加载驱动程序类。然后我按要求加上cj就不显示警告了。

其中在调试过程中,有这么一条警告:

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

我开始以为是数据库的问题,后来发现是驱动的问题,然后我感觉以后遇到这种与server、connection(服务器,不能链接啥啥的)等相关词的,可以先考虑是不是驱动的问题,因为还没有连接成功。

另外在修改pom.xml文件后,记得点一下maven,否则配置不会被更改。

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 解决办法的更多相关文章

  1. Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com.test.bean.groupMapper is not known to the MapperRegistry.

    Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com. ...

  2. MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser

    信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@41cf53f9: startup ...

  3. MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法

    报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound st ...

  4. Exception in thread "main" org.apache.hadoop.security.AccessControlException: Permission denied: user=lenovo, access=WRITE, inode="/user/hadoop/spark/people_savemode_test/_temporary/0":hadoop:supergro

    保存文件时权限被拒绝 曾经踩过的坑: 保存结果到hdfs上没有写的权限 通过修改权限将文件写入到指定的目录下 * * * $HADOOP_HOME/bin/hdfs dfs -chmod 777 /u ...

  5. Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused (Connection refused)

    一.linux中配置redis,使用java连接测试时报错: Exception in thread "main" redis.clients.jedis.exceptions.J ...

  6. HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

    HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.e ...

  7. Exception in thread "main" org.apache.hadoop.security.AccessControlException: Permission denied: user=Mypc, access=WRITE, inode="/":fan:supergroup:drwxr-xr-x

    在window上编程提示没有写Hadoop的权限 Exception in thread "main" org.apache.hadoop.security.AccessContr ...

  8. mybatis bug之org.apache.ibatis.exceptions.PersistenceException:

    详细报错信息: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java. ...

  9. org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent succ

    数据库 没有开启  连接失败 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause ...

  10. MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException

    错误信息如下: HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache. ...

随机推荐

  1. php 过滤掉emoji表情

    <?php function filter_emoji($str) { $str = preg_replace_callback( //执行一个正则表达式搜索并且使用一个回调进行替换 '/./u ...

  2. Delphi 动态生成进度条窗体

    在implementation加入下面 uses Gauges; var Gauge1: TGauge; 加入Timer1控件,设为false procedure TForm1.Button1Clic ...

  3. ANSYS 导出节点的位移数据

    1. 数据保存 确定待提取的节点编号: 获取节点位移变量: 将节点位移变量存储到数组中,用于数据传递: ! 输出对应节点的位移到csv文件 ! 注意同时导入.db和.rst,并切换到/post26模块 ...

  4. ANSYS 命令流导航

    常见书籍 ANSYS 命令流导航 GitHub 项目:ANSYS_Code Gitee 镜像:ANSYS_Code 欢迎补充~ 文件说明 doc 中包括 ANSYS, ABAQUS, LS-DYNA ...

  5. Golang 301永久重定向

    比如我要把www.taadis.com永久重定向到taadis.com //main.go package main import ( "log" "net/http&q ...

  6. 从客户端(XXX)中检测到有潜在危险的 Request.Form 值

    维护别人的某功能模块的时候,页面返回如下错误信息: [HttpRequestValidationException (0x80004005): 从客户端(TextBox1="<?xml ...

  7. 学习unigui【18】unidbgrid的GridsGroupingSorting

    折腾二天,你不按照demo里的代码来,就是没有效果.功力不够导致的.学习学习再学习!努力努力再努力! procedure TUniGridsGroupingSorting.UniDBGrid1Mult ...

  8. 读取excel单元格填过得的坑

    通过TdxSpreadSheet读取excel单元格值. 有一个cxDBTreeList来来表现科室单元,可是从科室单元excel文件中读取单元内容后,各种报错.一度怀疑cxdbtree的bug. 实 ...

  9. github仓库的README文件在线预览视频

    1. 新建一个 issue ,在 issue 里面上传 mp4 视频文件(有限制,不能超过10MB) 上传超过10MB的视频会提示报错 2. 拿到视频文件的上传地址 3. 将这个地址直接贴到 READ ...

  10. Rust实战系列-Rust介绍

    " 学习资料:rust in action[1] 1. Rust 安装 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | ...