jeecgboot / JeecgBoot

🔥「企业级低代码平台」前后端分离架构SpringBoot 2.x/3.x,SpringCloud,Ant Design&Vue3,Mybatis,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式,引入AI模型能力 OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。
http://www.jeecg.com
Apache License 2.0
40.67k stars 14.84k forks source link

重启后定时任务quartz不能自动执行 #5943

Closed truthsun22 closed 8 months ago

truthsun22 commented 8 months ago
版本号:3.6.0(发布日期:2023-10-23)
前端版本:vue3版
问题描述:

两个问题: 1 springboot强行关闭,然后重新启动,之前的定时任务quartz不能自动启动,必须手动启动才可以 2 然后从页面点击启动后,会报如下错误(错误信息太多,这里有删减),然后就能正常启动

2024-03-05 11:15:51.583 [http-nio-7001-exec-8] ERROR druid.sql.Statement:148 - {conn-10004, pstmt-20026} execute error. SELECT * FROM QRTZ_LOCKS WHERE SCHED_NAME = 'MyScheduler' AND LOCK_NAME = ? FOR UPDATE com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet successfully received from the server was 10,008 milliseconds ago. The last packet sent successfully to the server was 10,008 milliseconds ago. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) 。。。。。

Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure 。。。。。 The last packet successfully received from the server was 10,008 milliseconds ago. The last packet sent successfully to the server was 10,008 milliseconds ago. 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.NativeProtocol.readMessage(NativeProtocol.java:520) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:700) at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:639) at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:987) at com.mysql.cj.NativeSession.execSQL(NativeSession.java:666) at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:930) ... 138 common frames omitted Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at java.net.SocketInputStream.read(SocketInputStream.java:171) at java.net.SocketInputStream.read(SocketInputStream.java:141) at com.mysql.cj.protocol.ReadAheadInputStream.fill(ReadAheadInputStream.java:107) at com.mysql.cj.protocol.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:150) at com.mysql.cj.protocol.ReadAheadInputStream.read(ReadAheadInputStream.java:180) at java.io.FilterInputStream.read(FilterInputStream.java:133) at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:64) at com.mysql.cj.protocol.a.SimplePacketReader.readHeaderLocal(SimplePacketReader.java:81) at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63) at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45) at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:52) at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:41) at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:54) at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:44) at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:514) ... 143 common frames omitted 2024-03-05 11:15:51.590 [http-nio-7001-exec-8] ERROR com.alibaba.druid.pool.DruidPooledStatement:370 - CommunicationsException, druid version 1.2.19, jdbcUrl : jdbc:mysql://localhost:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai, testWhileIdle true, idle millis 1201861, minIdle 5, poolingCount 3, timeBetweenEvictionRunsMillis 60000, lastValidIdleMillis 1201861, driver com.mysql.cj.jdbc.Driver, exceptionSorter com.alibaba.druid.pool.vendor.MySqlExceptionSorter 2024-03-05 11:15:51.596 [http-nio-7001-exec-8] ERROR com.alibaba.druid.pool.DruidDataSource:1989 - {conn-10004} discard com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 。。。 2024-03-05 11:15:53.636 [http-nio-7001-exec-8] WARN o.q.i.j.AttributeRestoringConnectionInvocationHandler:144 - Failed restore connection's original auto commit setting. java.sql.SQLException: connection disabled 。。。。 2024-03-05 11:15:53.652 [http-nio-7001-exec-8] ERROR o.s.scheduling.quartz.LocalDataSourceJobStore:3941 - ClusterManager: Error managing cluster: Failure obtaining db row lock: connection disabled org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: connection disabled

truthsun22 commented 8 months ago

不好意思,我自己弄错了,单体切换微服务后,定时任务配置没修改,请关闭该issue