Quartz:error threw an unhandled Exception

Source: Internet
Author: User

Detailed error information is as follows:

1  .- .- -  -: -:13.366[defaultquartzscheduler_worker-1] ERROR Org.quartz.core.JobRunShell:211-Job Group1.job1 threw an unhandled Exception:2 java.lang.NullPointerException3At Com.starunion.java.service.timer.JobEndConference.execute (Jobendconference.java: $) ~[bin/:?]4At Org.quartz.core.JobRunShell.run (Jobrunshell.java:202) [quartz-2.2.1. Jar:?]5At Org.quartz.simpl.simplethreadpool$workerthread.run (Simplethreadpool.java:573) [quartz-2.2.1. Jar:?]6  .- .- -  -: -:13.374[defaultquartzscheduler_worker-1] ERROR Org.quartz.core.ErrorLogger:2425-Job (Group1.job1 threw an exception.7 Org.quartz.SchedulerException:Job threw an unhandled exception.8At Org.quartz.core.JobRunShell.run (Jobrunshell.java:213) [quartz-2.2.1. Jar:?]9At Org.quartz.simpl.simplethreadpool$workerthread.run (Simplethreadpool.java:573) [quartz-2.2.1. Jar:?]Ten caused By:java.lang.NullPointerException OneAt Com.starunion.java.service.timer.JobEndConference.execute (Jobendconference.java: $) ~[bin/:?] AAt Org.quartz.core.JobRunShell.run (Jobrunshell.java:202) ~[quartz-2.2.1. Jar:?]

Tell me about my resolution process:

One, the reason is obvious: a null object was called.

Based on the log information, navigate to the 21 rows of the specified row of my Job Object class:

1 @Component2  Public classJobendconference implements Job {3 4 @Autowired5 Callablefsexeccmdproc Procexectask;6 7 @Override8      Public voidExecute (jobexecutioncontext jecontext) throws Jobexecutionexception {9 TenJobdatamap map =Jecontext.getjobdetail (). Getjobdatamap (); One  AString meetname = (string) map.Get("Meetname"); -  -StringBuffer buff =NewStringBuffer (); theBuff.append ("BGAPI Conference"); - buff.append (meetname); -Buff.append ("Kick All"); -         //buff.append (constantutil.fs_cmd_tail); +          -         //Socketfstcp4sendcmd.fssendcommand (buff.tostring ()); + Procexectask.setsendcmd (buff.tostring ()); Afuture<integer> future =StarProxy.executor.submit (procexectask); at         Try { -Future.Get( the, timeunit.milliseconds); -}Catch(Interruptedexception | executionexception |timeoutexception e) { - e.printstacktrace (); -         } -  in     } -  to}

This object is empty, which means that there is no correct initialization through spring annotations.

Make sure that this annotation is written correctly, and that all other classes do.

Second, where is the problem?

Look up and see the invocation of this class.

1 ...... 2 jobdetail jobdetail = Newjob (jobendconference.  Class). Withidentity ("job1""group1"). Setjobdata (DM). build (); 3 ...

The reason for this is that the Newjob incoming object parameter is not the object that the spring annotation loads.

Third, the solution:

1. Get the Jobendconference object from spring's applicationcontext.

2. Uncomment the jobendconference itself and parameters and initialize with new.

Quartz:error threw an unhandled Exception

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.