Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 解决办法
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: 解决办法的更多相关文章
- 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. ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- mybatis bug之org.apache.ibatis.exceptions.PersistenceException:
详细报错信息: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java. ...
- 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 ...
- MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException
错误信息如下: HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache. ...
随机推荐
- mac ping IP+端口的方法
nc -vz -w 2 192.168.1.104 3306
- Windows下PostgreSQL设置远程连接以及备份和恢复数据库
一.设置远程连接 修改安装路径下的postgresql.conf,定位到listen_address = '*',确保其值为'*'(Windows下默认是这样的,可不用修改) 修改安装路径下的pg_ ...
- SpringBoot集成LDAP认证登录
Maven依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="htt ...
- 保存深度值——小端序,位数,Android,Huawei AR engine
保存深度值--小端序,位数,Android accuireDepthImage 华为Mate Pro系列基本上前置摄像头都是有TOF的,也就是能够得到场景的深度信息,在华为的AR engine里提供了 ...
- 内部类--匿名内部类--java进阶day03
1.匿名内部类 在介绍匿名内部类前,先引用一段代码材料,通过这段代码来理解匿名内部类 如下图,我们定义了接口和一个方法,方法中调用该接口的抽象方法,这时我们要调用use方法,但是该怎么传参呢? 我们将 ...
- 【C语言】gcc编译时报错 fatal error: stdio.h: 没有那个文件或目录
零.问题 在Ubuntu20.04.6中使用GCC编译一个HelloWorld代码时遇到如下问题: 首先确认了,自己单词没有拼写错. 然后再检查GCC的版本,确实没问题: 我用的是Ubuntu20.0 ...
- PG的子查询:insert 没有就插入记录,update有则更新记录
insert into t --进行插入 values(1,'name') ON CONFLICT(id) --如果id这个键存在 do update set --更新以下字段 name=EXCLUD ...
- .NET周刊【3月第3期 2025-03-16】
国内文章 在 VisualStudio 一键 F5 启动调试 Roslyn 分析器项目 https://www.cnblogs.com/lindexi/p/18730521 本文将告诉大家如何在 Vi ...
- .net core基础(一):安装并创建第一个webapi
一..net介绍 .net是一个开发者平台的统称,用它可以构建多种类型的应用程序. .net平台下的开发语言:C#,F#,Visual Basic .net平台标准:.NET Standard .ne ...
- SpringAI版本更新:向量数据库不可用的解决方案!
Spring AI 前两天(4.10 日)更新了 1.0.0-M7 版本后,原来的 SimpleVectorStore 内存级别的向量数据库就不能用了,Spring AI 将其全部源码删除了. 此时我 ...