Reasons why quartz cannot be started

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.