Symptoms
Import of a Process Definition fails with
ERROR 2023-12-26 11:14:09,756 GMT [Redwood Job Thread Pool: GLOBAL.System.System worker 0] job.System_Import_Archive.16207292 - Import failed, no objects have been imported.
ERROR 2023-12-26 11:14:09,756 GMT [Redwood Job Thread Pool: GLOBAL.System.System worker 0] job.System_Import_Archive.16207292 - Error during import
JCS-122035: Unable to persist: JCS-102250: Unexpected exception processing Process Definition Related Object <Process Definition Not Set>.
Cause
JobChain objects are missing a reference to JobDefinition objects
Workaround
Navigate to Scripting > Shell and execute following to find out if you are affected
import java.util.Iterator;
import com.redwood.scheduler.api.model.interfaces.RWIterable;
import com.redwood.scheduler.api.model.*;
{
String queryJobs = "select jc.* from JobChain jc where jc.JobDefinition not in (select jd.UniqueId from JobDefinition jd)";
boolean persist=false;
int jcCounter = 0;
int batchSize=50;
if(!persist) jcsOut.println("This is a test run, no modification will be done!");
for(Iterator<JobChain> jobChains = jcsSession.executeObjectQuery(JobChain.TYPE, queryJobs); jobChains.hasNext();)
{
JobChain jc = jobChains.next();
JobDefinitionType jdtJC = jcsSession.getJobDefinitionTypeByName(JobDefinitionType.JOB_CHAIN);
JobDefinition jdjc = jcsSession.createJobDefinition();
jdjc.setName("DummyJobChain_"+jcCounter);
jdjc.setJobDefinitionType(jdtJC);
jc.setJobDefinition(jdjc);
if(persist) jcsSession.persist();
jdjc.deleteObject();
if(persist) jcsSession.persist();
jcCounter++;
jcsOut.println("Found Job chain ("+jc.getUniqueId()+") without JobDefinition of JobChainType, will be deleted if persist is true.");
//persist changes in batches
if(jcCounter%batchSize==0 && persist){
jcsSession.persist();
jcsOut.println("modification done!");
}
}
if(persist) jcsSession.persist(); // final persist
jcsOut.println("Found "+ jcCounter + " process without JobDefinition assigned");
}
When you are getting results like below then modify boolean persist=false;
to boolean persist=true;
and execute the script once more.
Found Job chain (498688559) without JobDefinition of JobChainType, will be deleted if persist is true.
Affected version
RunMyJobs 9.2.x. and higher
Reference
RCORE-46252
Error
ERROR 2023-12-26 11:14:09,756 GMT [Redwood Job Thread Pool: GLOBAL.System.System worker 0] job.System_Import_Archive.16207292 - Import failed, no objects have been imported.
ERROR 2023-12-26 11:14:09,756 GMT [Redwood Job Thread Pool: GLOBAL.System.System worker 0] job.System_Import_Archive.16207292 - Error during import
JCS-122035: Unable to persist: JCS-102250: Unexpected exception processing Process Definition Related Object <Process Definition Not Set>.
at com.redwood.scheduler.model.SchedulerSessionImpl.writeDirtyListLocal(SchedulerSessionImpl.java:1034)
at com.redwood.scheduler.model.SchedulerSessionImpl.persist(SchedulerSessionImpl.java:967)
at com.redwood.scheduler.system.jobs.imp.DefaultImporter.executeImport(DefaultImporter.java:560)
at com.redwood.scheduler.system.jobs.imp.DefaultImporter.execute(DefaultImporter.java:1479)
at com.redwood.scheduler.system.jobs.CronacleArchiveImport.run(CronacleArchiveImport.java:338)
at com.redwood.scheduler.system.jobs.CommonSystemJob.execute(CommonSystemJob.java:46)
at com.redwood.scheduler.systemjobservice.api.JobWorker.runProcessExecute(JobWorker.java:267)
at com.redwood.scheduler.systemjobservice.api.JobWorker.processExecute(JobWorker.java:204)
at com.redwood.scheduler.systemjobservice.api.JobWorker.doWork(JobWorker.java:125)
at com.redwood.scheduler.systemjobservice.api.JobWorker.doWork(JobWorker.java:64)
at com.redwood.scheduler.infrastructure.workqueue.WorkQueueWorker.run(WorkQueueWorker.java:72)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.redwood.scheduler.model.exception.UnexpectedListenerException: JCS-102250: Unexpected exception processing Process Definition Related Object <Process Definition Not Set>.
at com.redwood.scheduler.model.LowLevelPersistenceConfigurationImpl.throwUnexpectedExceptionDuringListenerExecution(LowLevelPersistenceConfigurationImpl.java:682)
at com.redwood.scheduler.persistence.impl.LowLevelPersistenceImpl.informListeners(LowLevelPersistenceImpl.java:1105)
at com.redwood.scheduler.persistence.impl.LowLevelPersistenceImpl.writeDirtyObjectListRetry(LowLevelPersistenceImpl.java:332)
at com.redwood.scheduler.persistence.impl.LowLevelPersistenceImpl$WriteDirtyObjectListUnitOfWork.execute(LowLevelPersistenceImpl.java:118)
at com.redwood.scheduler.persistence.impl.LowLevelPersistenceImpl.writeDirtyObjectList(LowLevelPersistenceImpl.java:181)
at com.redwood.scheduler.cluster.persistence.ClusteredLowLevelPersistence.writeDirtyObjectList(ClusteredLowLevelPersistence.java:65)
at com.redwood.scheduler.model.SchedulerSessionImpl.writeDirtyListLocal(SchedulerSessionImpl.java:1009)
... 11 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.redwood.scheduler.apiint.model.JobDefinitionInt.isModifiable()" because the return value of "com.redwood.scheduler.model.method.impl.JobDefinitionRelatedObjectMethodImpl.getJobDefinitionInt()" is null
at com.redwood.scheduler.model.method.impl.JobDefinitionRelatedObjectMethodImpl.isModifiableInt(JobDefinitionRelatedObjectMethodImpl.java:56)
at com.redwood.scheduler.model.method.impl.SchedulerEntityMethodImpl.vetoPhaseHandler(SchedulerEntityMethodImpl.java:149)
at com.redwood.scheduler.model.method.impl.JobDefinitionRelatedObjectMethodImpl.vetoPhaseHandler(JobDefinitionRelatedObjectMethodImpl.java:63)
at com.redwood.scheduler.model.BaseSchedulerEntityImpl.vetoPhaseHandler(BaseSchedulerEntityImpl.java:1300)
at com.redwood.scheduler.model.SchedulerEntityImpl.vetoPhaseHandler(SchedulerEntityImpl.java:492)
at com.redwood.scheduler.model.RootImpl.vetoPhaseHandler(RootImpl.java:843)
at com.redwood.scheduler.model.JobDefinitionRelatedObjectImpl.vetoPhaseHandler(JobDefinitionRelatedObjectImpl.java:454)
at com.redwood.scheduler.model.JobChainImpl.vetoPhaseHandler(JobChainImpl.java:1474)
at com.redwood.scheduler.model.listeners.PerformVetoListener.modelModified(PerformVetoListener.java:31)
at com.redwood.scheduler.persistence.impl.LowLevelPersistenceImpl.informListeners(LowLevelPersistenceImpl.java:1089)
... 16 more
Comments
0 comments
Please sign in to leave a comment.