The code of the JAVA project has hardly been changed. After re-release, it suddenly reports an error and cannot start

Project scenario:

提示:这里简述项目相关背景:

The code of the JAVA project has hardly been changed. After re-release, it suddenly reports an error and cannot start


Problem Description

提示:这里描述项目中遇到的问题:

The JAVA project code has hardly been changed. After re-release, it suddenly reports an error and cannot start. The error message is as follows:
insert image description here


Cause Analysis:

Tip: Fill in the analysis of the problem here:

Because I hardly changed the code in the project, but the above error suddenly appeared in the background console after republishing, and

We can see from the error message that it is related to the scheduled task, so we can basically be sure that it is not caused by the code, and we cannot obtain other detailed information from the log information.

View the timed task related data table:
insert image description here

solution:

Tip: Specific solutions:

The most direct way to generate dirty data in the database is to clear the scheduled task log table

It should be noted that there is a relationship between the tables in the scheduled task log table, so it is necessary to clear or delete the table according to the order of the table association, otherwise it will prompt that the data cannot be deleted or cleared.

Note:
The data information in the qrtz_job_details table needs to be deleted
. It should be noted that if we directly delete the data in the qrtz_job_details table, it cannot be deleted, and a prompt message will appear, as shown in the figure below:
insert image description here

Therefore, we must first understand the relationship between the tables of the timed task. Among them, the qrtz_triggers table has a foreign key reference to qrtz_job_details, and the qrtz_cron_triggers table has a foreign key reference to qrtz_triggers. Therefore, the data must be deleted in the order of the table foreign key references success,
ie:

Delete the data in the qrtz_cron_triggers table first, then delete the data in the qrtz_triggers table, and finally delete the data in the qrtz_job_details table.

Guess you like

Origin blog.csdn.net/YHLSunshine/article/details/130091551