关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、418799587 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 9736|回复: 1

尝试连接未配置的本地数据库,导致查询失败

[复制链接]
发表于 2022-9-15 15:58:11 | 显示全部楼层 |阅读模式
使用online报表配置的弹窗时,会新建数据库连接,尝试连接本地的数据库,导致连接超时、查询失败,请问该怎么解决
2022-09-15 15:52:11.385 [http-nio-8080-exec-4] INFO  org.jeecg.common.aspect.PermissionDataAspect:66 - 拦截请求 >> /online/cgreport/api/getData/1521825023618314241 ; 请求类型 >> GET .
2022-09-15 15:52:11.516 [http-nio-8080-exec-4] INFO  org.jeecg.common.util.dynamic.db.DynamicDBUtil:55 - ******************************************
2022-09-15 15:52:11.517 [http-nio-8080-exec-4] INFO  org.jeecg.common.util.dynamic.db.DynamicDBUtil:56 - *                                        *
2022-09-15 15:52:11.518 [http-nio-8080-exec-4] INFO  org.jeecg.common.util.dynamic.db.DynamicDBUtil:57 - *====【local_mysql】=====Druid连接池已启用 ====*
2022-09-15 15:52:11.519 [http-nio-8080-exec-4] INFO  org.jeecg.common.util.dynamic.db.DynamicDBUtil:58 - *                                        *
2022-09-15 15:52:11.520 [http-nio-8080-exec-4] INFO  org.jeecg.common.util.dynamic.db.DynamicDBUtil:59 - ******************************************
2022-09-15 15:52:11.521 [http-nio-8080-exec-4] INFO  org.jeecg.common.util.dynamic.db.DynamicDBUtil:84 - --------getDbSourceBydbKey------------------创建DB数据库连接-------------------
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.
2022-09-15 15:52:11.550 [http-nio-8080-exec-4] INFO  com.alibaba.druid.pool.DruidDataSource:994 - {dataSource-2} inited
2022-09-15 15:52:11.582 [Druid-ConnectionPool-Create-771654402] ERROR com.alibaba.druid.pool.DruidDataSource:2781 - create connection SQLException, url: jdbc:mysql://127.0.0.1:3306/ds01?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai, errorCode 0, state 08S01
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1710)
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2779)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
        at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
        at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89)
        at com.mysql.cj.NativeSession.connect(NativeSession.java:144)
        at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)
        ... 6 common frames omitted
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
        at java.net.Socket.connect(Socket.java:606)
        at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)
        at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63)
        ... 9 common frames omitted
2022-09-15 15:52:11.585 [Druid-ConnectionPool-Create-771654402] INFO  com.alibaba.druid.pool.DruidAbstractDataSource:1791 - {dataSource-2} failContinuous is true
2022-09-15 15:52:41.557 [http-nio-8080-exec-4] WARN  com.alibaba.druid.pool.DruidDataSource:1414 - get connection timeout retry : 1

 楼主| 发表于 2022-9-15 16:42:45 | 显示全部楼层
有人可以回复解答一下吗?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表