java.lang.NullPointerException: Cannot invoke
"com.alibaba.druid.stat.JdbcDataSourceStat.getRuningSqlList()" because the
return value of "com.alibaba.druid.pool.DruidDataSource.getDataSourceStat()" is
null

原因:版本不一致出现。使用的是5.x.x的。

解决:改了就可以了(之前是5.x.x)

在mysql中执行SELECT VERSION()

mysql-connector-java版本需与mysql版本一致
<!--mysql驱动--> <dependency> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <version>8.0.27</version>
<scope>compile</scope> </dependency>

注意:检查数据库版本

com.mysql.jdbc.Driver 是 mysql-connector-java 5及5之前的,

com.mysql.cj.jdbc.Driver 是 mysql-connector-java 6及6之后的的。

技术
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信