Quartz Error: Java.lang.classNotFoundException

Source: Internet
Author: User

Recently in a scheduling platform to transform the project, quartz in the test environment running is a single-machine environment, production of two servers to do the cluster.

Test environment is OK, production on-line error, a class java.lang.classNotFoundException (note: This class was modified by others name, now use the new name)

First time: Failure

A reference to the old job class was excluded from the code (both the configuration file and the class are removed)

Presumably, the server caches the class.


Clear the cache, restart the server, and still report the above error.

Second time: Failure

Pull the production configuration onto the test environment, Test repeatedly, and automatically clear the cache when the server is restarted.

It is assumed that the class of quartz is a global variable and will be synchronized in production.


Set up a dispatch server again on the test environment, pull configuration and execution all from production to the test environment, execute OK

Repeated debugging, there are still no signs of synchronization.

Did not reproduce the production of the anomaly, dare not go online.

Third time: Success

So where exactly does this old job class call from? I can't find a clue! Will it be saved to the database?

At the time, the idea was funny, and from a design standpoint, quartz should not allow other classes to be introduced into their own systems.

But there is no way to go, just look at the database and see if it is saved in the database. You guessed it, it was lying on the table in the database:

CREATE TABLEqrtz_job_details (job_nameVARCHAR( $) not NULL, Job_groupVARCHAR( $) not NULL, DESCRIPTIONVARCHAR( -)NULL,job_class_name VARCHAR (+) not NULL ,is_durableVARCHAR(1) not NULL, Is_volatileVARCHAR(1) not NULL, Is_statefulVARCHAR(1) not NULL, Requests_recoveryVARCHAR(1) not NULL, Job_data BLOBNULL,PRIMARY KEY(Job_name,job_group)) TYPE=InnoDB;

All right! Look at the field and discover that it is really the old class that is not the new class.

So why did you find it in the test environment?

Into the test library, and no old classes were found, OK.

The old project was a pit, and I fell into the gazed.


The computer is a rational thing, so everything is possible, even the most unlikely thing to go to one by one to confirm. When looking for a problem, it's best to think clearly about all the possible failures and then exclude them until you find the final question.

For web development, the general idea for solving this type of problem is as follows:

1, from a global point of view, the application, cache, the database is the three independent modules, these parts are likely to be abnormal, you should first troubleshoot the application itself (the probability of the most), followed by the cache (synchronization) module troubleshooting, and finally the database module troubleshooting.

2, the overall determination of the premise, the subdivision of the above-mentioned modules, the possible problems listed.

3, hands-on, verify ideas. For a good developer, hands-on is only a means of verification, thinking is the most important.

Quartz Error: Java.lang.classNotFoundException

Related Article

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.