The detailed error message is as follows:
1 2016 - 06 - 28 . 17 : 18 is : 13.366 [DefaultQuartzScheduler_Worker- . 1 ] ERROR org.quartz.core.JobRunShell: 211 - the Job group1.job1 threw AN Unhandled Exception: 2 java.lang.NullPointerException 3 AT com.starunion.java. service.timer.JobEndConference.execute(JobEndConference.java: 45 ) ~[bin/:? ] 4 at org.quartz.core.JobRunShell.run(JobRunShell.java: 202 ) [quartz- 2.2 . 1 .jar:? ] 5 org.quartz.simpl.SimpleThreadPool $ WorkerThread.run AT (SimpleThreadPool.java: 573 ) [quartz- 2.2 . . 1 .jar :? ] 6 2016 - 06 - 28 . 17 : 18 is : 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. 8 at org.quartz.core.JobRunShell.run(JobRunShell.java: 213 ) [quartz- 2.2 . 1 .jar:?] 9 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java: 573 ) [quartz- 2.2 . 1 .jar:? ] 10 Caused by: java.lang.NullPointerException 11 at com.starunion.java.service .timer.JobEndConference.execute(JobEndConference.java: 45 ) ~[bin/:? ] 12 at org.quartz.core.JobRunShell.run(JobRunShell.java: 202 ) ~[quartz- 2.2 . 1 .jar:?]
Talk about my solution process:
1. The reason is obvious: the null object is called.
According to the log information, locate the specified line of my Job object class, line 21 in the following figure:
1 @Component 2 public class JobEndConference implements Job { 3 4 @Autowired 5 CallableFsExecCmdProc procExecTask; 6 7 @Override 8 public void execute(JobExecutionContext JEContext) throws JobExecutionException { 9 10 JobDataMap map = JEContext.getJobDetail().getJobDataMap(); 11 12 String meetName = (String) map. get ( " meetName " ); 13 14 StringBuffer buff = newStringBuffer(); 15 buff.append( " bgapi conference " ); 16 buff.append(meetName); 17 buff.append( " kick all " ); 18 // buff.append(ConstantUtil.FS_CMD_TAIL); 19 20 // SocketFsTcp4SendCMD.fsSendCommand(buff.toString()); 21 procExecTask.setSendCmd(buff.toString()); 22 Future<Integer> future = StarProxy.executor.submit(procExecTask); 23 try { 24 future. get ( 5000, TimeUnit.MILLISECONDS); 25 } catch (InterruptedException | ExecutionException | TimeoutException e) { 26 e.printStackTrace(); 27 } 28 29 } 30 31 }
This object is empty, which means that it has not been properly initialized through Spring annotations.
Make sure that this annotation is written correctly, all other classes are written this way.
2. Where is the problem?
Check up to see how this class is called.
. 1 ...... 2 the JobDetail jobDetail = newJob (JobEndConference. Class ) .withIdentity ( " the jobs that job1 " , " named group1 " ) .setJobData (DM) .build (); . 3 ......
The reason is that the object parameter passed in by newJob is not the object loaded by the Spring annotation.
3. Solution:
Method 1. Obtain the JobEndConference object from Spring’s ApplicationContext.
Method 2. Cancel the annotation of JobEndConference itself and parameters, and initialize with new.
Read More:
- Springboot integrates redis factory method ‘redisconnectionfactory’ threw exception; nested exception is
- Spring bean object cannot be injected into quartz job
- [Solved] Unity Package Error: FAILURE: Build failed with an exception.
- How to Solve Docker Error: elasticsearch exception: type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
- [Solved] unhandled error during execution of watcher callback
- unhandled system error, NCCL version 2.7.8 [How to Solve]
- android mediaplayer went away with unhandled event after the recording stopped
- ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,009 ms]
- Node js events.js:183 throw er; // Unhandled ‘error’ event
- Error code: events.js:183 Thrower; //unhandled ‘error’ event – solution
- Node.js Error: throw er; // Unhandled ‘error‘ event [How to Solve]
- laravel-echo-server Run Error: [ioredis] Unhandled error event: ReplyError: NOAUTH Authentication required.
- [Solved] NCCL error in: /pytorch/torch/lib/c10d/ProcessGroupNCCL ,unhandled cuda error, NCCLversion 2.7.8
- [Solved] Angular build Error: throw er; // Unhandled ‘error’ eventEmitted ‘error’ event on ChildProcess instance
- POI Export Excel Error: HTTP Status 500 – Request processing failed; nested exception is java.lang.NullPointerException
- NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError [Solved]
- [Solved] liquibase.exception.ValidationFailedException: Validation Failed
- [Solved] Error: exception: java.lang.reflect.InvocationTargetException: null
- [Solved] Springcloud Add gateway to Startup Error: Exception encountered during context initialization – cancelling refresh
- com.netflix.zuul.exception.zuulexception Timeout (Fixed)