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. Java基于XXLJOB的定时任务实现阶梯式通知方式

    数据库表设计 CREATE TABLE `tx_order_push_info` ( `order_no` varchar(64) DEFAULT NULL COMMENT '交易单号', `orde ...

  2. ORACLE忘记用户名和密码、解锁、查询

    一.Oracle忘记用户名和密码 1.打开命令提示符,输入命令sqlplus ,进入oracle控制台 2.用户名输入 sqlplus/as sysdba,口令:空(回车即可) 3.连接成功后,输入& ...

  3. udl(Universal Data Link)通用数据连接文件

    新建文本文档 更改后缀名为.udl(注意小点) 然后打开运行 配置并测试 改回后缀名.txt(有个小点哦) 打开就是了

  4. 【AI工具实战】一招解决英文视频困境,四步用AI搞定全中文字幕,你也可以!(文末附工具下载)

    "AI时代最大的红利,是让每个人都有机会成为那个"想到就能做到"的创造者." AI粉嫩特攻队,2025年4月5日. 故事源于一个我想看的国外视频.本想点开视频准 ...

  5. K8S 部署 Deepseek 要 3 天?别逗了!Ollama+GPU Operator 1 小时搞定

    最近一年我都在依赖大模型辅助工作,比如 DeepSeek.豆包.Qwen等等.线上大模型确实方便,敲几个字就能生成文案.写代码.做表格,极大提高了效率.但对于企业来说:公司内部数据敏感.使用外部大模型 ...

  6. 如何处理 MySQL 的主从同步延迟?

    如何处理 MySQL 的主从同步延迟? MySQL 的主从同步延迟通常是由主库与从库之间的网络延迟.从库的处理能力.主库的写操作量等因素导致的.长时间的同步延迟可能会影响系统的稳定性和数据一致性.以下 ...

  7. Spring Security认证与授权

    什么是Spring Security Spring Security是基于Spring框架,提供了一套Web应用安全性框架.专门为Java应用提供用户认证(Authentication)和用户授权(A ...

  8. fiddler抓包常用辅助工具

    一.过滤器 1.hosts: 只展示内网或外网的hosts,internet(外网),Intranet(内网) 展示下面的hosts/隐藏下面的hosts/:选择后填写需要设置的hosts(地址前面的 ...

  9. 一文带你看透什么是ResNet

    目录 什么是ResNet 提出背景 梯度爆炸/梯度消失: 退化现象: 原理解析 网络结构 参考资料 什么是ResNet 首先我们来看什么是ResNet,其全称为Residual Network(残差网 ...

  10. cesium裁切面实践

    cesium裁切面实践:沙盒地址 (打不开的自行科学访问) 裁切面法线方向指向保留的部分,本案例通过法线配合unionClippingRegions参数实现相比官方案例没有的:多裁切面互裁,裁两边留中 ...