报错c.a.d.p.DruidPooledStatement - [errorCheck,370] - CommunicationsException, druid version/### Error

文章描述了一种常见的编程错误,即在使用Druid数据源连接MySQL数据库时遇到CommunicationsException,导致链接失败。错误可能涉及具体的MapperSQL和参数设置。解决方案是检查并修正XML文件中参数设置的问题,特别是在接参异常时。此外,接口测试工具能快速定位报错点。
摘要由CSDN通过智能技术生成

详细报错:

控制台前面的报错信息都是废话,直接往下拉,需要留意的几个带###的报错信息如下:
### The error may exist in file(发生错误的详细文件位置
### The error may involve   (发生错误的详细Mapper的SQL
### The error occurred while setting parameters (这个 错误 发生在 设置 参数 时
### SQL: SELECT * FROM xxxxxxxx(发生错误的详细SQL打印
### Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

 控制台直接往下拉,看后面:

到这里还在说废话,直接看 ### 的这几句就完了:

c.a.d.p.DruidPooledStatement - [errorCheck,370] - CommunicationsException, druid version 1.2.16, jdbcUrl : jdbc:mysql://10.27.30.33:36060/enterprise-man?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8, testWhileIdle true, idle millis 53279, minIdle 10, poolingCount 4, timeBetweenEvictionRunsMillis 60000, lastValidIdleMillis 53279, driver com.mysql.cj.jdbc.Driver, exceptionSorter com.alibaba.druid.pool.vendor.MySqlExceptionSorter
15:39:39.229 [http-nio-8080-exec-1] ERROR c.a.d.p.DruidDataSource - [handleFatalError,1954] - {conn-10005} discard

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

.....

.....

.....

The last packet successfully received from the server was 53,271 milliseconds ago. The last packet sent successfully to the server was 53,282 milliseconds ago.

.....

.....

.....

### Error querying database.  Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure     (发生错误的database

The last packet successfully received from the server was 53,271 milliseconds ago. The last packet sent successfully to the server was 53,282 milliseconds ago.
### The error may exist in file [C:\zhiZong\enterprise-man-service\enterpriseMan-service\target\classes\mapper\whjcxx\JcsbjcxxMapper.xml]   (发生错误的详细文件位置
### The error may involve   (发生错误的详细Mapper的SQL)com.ruoyi.enterpriseman.wh.mapper.JcsbjcxxMapper.selectJcsbjcxxListLimit-Inline
### The error occurred while setting parameters (这个 错误 发生在 设置 参数 时
### SQL: SELECT * FROM xxx where  sblxmc = ?    LIMIT ?,?(发生错误的详细SQL打印
### Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

其实如果是接口测试软件调取,一下子就可以看到报错点: 

根据### The error occurred while setting parameters  报错提示,找到xml中设置参数的地方:

 果不其然,是接参出异常了,修正即可

补充:

在parameterType即入参异常的情况下,也会出现这种情况

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值