Reasons why quartz cannot be started
Scenario: Spring integrates quartz and configures quartz parameters in the spring configuration file.
In the past work, quartz was often unable to start up. Today, based on previous experience, I will summarize it for your reference.
I. ID conflict
The two basic units of quartz are job and trigger. They are uniquely identified in the memory by jobname + groupname and triggername + grupname. If both jobs have the same name and group, A job cannot be started.
Ii. Default-Lazy-init = "true"
If Quartz-related parameters are configured in the spring configuration file, default-Lazy-init = "true" cannot be set; otherwise, scheduled tasks are not triggered; if the project has multiple spring configuration files, you only need to set the current quartz file without default-Lazy-init = "true.
Iii. Default-autowire = "byname"
If Quartz-related parameters are configured in the spring configuration file, the default-autowire = "byname" attribute cannot be set. Otherwise, table 'database is reported in the background. qrtz_locks 'doesn' t exist exception. This is because if autowire is used and quartz is integrated with spring, the database will be used by default to store the job status (not stored in memory ), spring automatically configures datasource (the database configured by hibernate) as the quartz storage database, and our database does not have the data table required by quartz, so the above exception is reported; if the project has multiple spring configuration files, you only need to set default-autowire = "byname" in the current quartz configuration file.