我在我的项目中使用批处理作业并将其部署在 weblogic 上。我在 weblogic 控制台中设置数据源和模式名称。当我想通过运行开始工作时,BatchRuntime.getJobOperator().start("test-job", new Properties())
出现以下错误:
javax.batch.operations.JobStartException: java.lang.NullPointerException
at com.ibm.jbatch.container.api.impl.JobOperatorImpl.start(JobOperatorImpl.java:92)
at com.test.job.JobUtils.startJob(JobUtils.java:19)
at com.test.job.WaitScheduler.execute(WaitScheduler.java:33)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused By: java.lang.NullPointerException
at com.ibm.jbatch.container.services.impl.SPIDelegatingThreadPoolServiceImpl.executeTask(SPIDelegatingThreadPoolServiceImpl.java:59)
at com.ibm.jbatch.container.impl.BatchKernelImpl.startJob(BatchKernelImpl.java:135)
at com.ibm.jbatch.container.api.impl.JobOperatorImpl.startInternal(JobOperatorImpl.java:123)
at com.ibm.jbatch.container.api.impl.JobOperatorImpl.start(JobOperatorImpl.java:88)
at com.test.job.JobUtils.startJob(JobUtils.java:19)
at com.test.job.WaitScheduler.execute(WaitScheduler.java:33)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
在 EXECUTIONINSTANCEDATA 我有以下记录:
+-------------+-----------------+--------------------------------+-------------+-----------+--------------------------------+--------------+---------------+--------------+
| "JOBEXECID" | "JOBINSTANCEID" | "CREATETIME" | "STARTTIME" | "ENDTIME" | "UPDATETIME" | "PARAMETERS" | "BATCHSTATUS" | "EXITSTATUS" |
+-------------+-----------------+--------------------------------+-------------+-----------+--------------------------------+--------------+---------------+--------------+
| "25457" | "25457" | "20-APR-18 12.55.24.157000 PM" | "" | "" | "20-APR-18 12.55.24.157000 PM" | "<BLOB>" | "STARTING" | "" |
+-------------+-----------------+--------------------------------+-------------+-----------+--------------------------------+--------------+---------------+--------------+
编辑:新堆栈跟踪(由 managedScheduledExecutorService 安排的作业)
javax.batch.operations.JobStartException: java.lang.NullPointerException
at com.ibm.jbatch.container.api.impl.JobOperatorImpl.start(JobOperatorImpl.java:92)
at com.test.job.JobUtils.startJob(JobUtils.java:22)
at com.test.job.JobStarter.run(JobStarter.java:18)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at weblogic.work.concurrent.TaskWrapper.call(TaskWrapper.java:151)
at weblogic.work.concurrent.future.AbstractFutureImpl.runTask(AbstractFutureImpl.java:391)
at weblogic.work.concurrent.future.AbstractFutureImpl.doRun(AbstractFutureImpl.java:436)
at weblogic.work.concurrent.future.ManagedScheduledFutureImpl.timerExpired(ManagedScheduledFutureImpl.java:86)
at weblogic.work.concurrent.future.ManagedPeriodFutureImpl.timerExpired(ManagedPeriodFutureImpl.java:97)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:301)
at weblogic.work.concurrent.future.ManagedScheduledFutureImpl.run(ManagedScheduledFutureImpl.java:96)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.lang.NullPointerException: null
at com.ibm.jbatch.container.services.impl.SPIDelegatingThreadPoolServiceImpl.executeTask(SPIDelegatingThreadPoolServiceImpl.java:59)
at com.ibm.jbatch.container.impl.BatchKernelImpl.startJob(BatchKernelImpl.java:135)
at com.ibm.jbatch.container.api.impl.JobOperatorImpl.startInternal(JobOperatorImpl.java:123)
at com.ibm.jbatch.container.api.impl.JobOperatorImpl.start(JobOperatorImpl.java:88)
... 17 common frames omitted