AnsweredAssumed Answered

org.activiti.engine.ActivitiException: couldn't instantiate class com.stud.listener.PrinterListener

Question asked by natedawg on Apr 14, 2016
Latest reply on Apr 29, 2016 by natedawg
Hi,

I did try to read other similar forum posts reported on this forum but I cannot see if those are exactly the same as mine issue. So here I go. Process is attached, ending as txt as xmls are not allowed to be uploaded.

The process starts with executing a service task (SequenceJob1) calling a java class. Then the process sleeps for 10 seconds (intermediate timer catching event, wait10S) so I can check the status of SequenceJob1 in another service task (CheckSequenceJob1Status). If the job is not finished (varStatus == 'F') then the loop of sleeping for 10 secs and checking status is repeated again. The error occurs right after the second time intermediate timer catching event executes. It manages to execute the PrinterListener (like the first time) but then throws exception (see below log).


<b>From the log</b> (take a look at 12:43:55,28 when a new thread is fired.

12:43:23,490 [http-apr-8080-exec-10] INFO  org.activiti.engine.impl.bpmn.deployer.BpmnDeployer  - Processing resource ProcDS1.bpmn20.xml
12:43:36,997 [http-apr-8080-exec-8] INFO  com.stud.service.StageService  - starting Stage job execution
12:43:38,202 [http-apr-8080-exec-8] INFO  com.stud.service.StageService  - execution completed
12:43:38,202 [http-apr-8080-exec-8] INFO  com.stud.service.StageService  - Variable name: varLastActivity
12:43:38,202 [http-apr-8080-exec-8] INFO  com.stud.service.listener.PrinterListener  - Activity name:wait10S    variables: [varLastActivity]
12:43:55,281 [pool-1-thread-2] INFO  com.stud.service.listener.PrinterListener  - Activity name:CheckSeqJob1Status    variables: [varLastActivity]
12:43:55,297 [pool-1-thread-2] INFO  com.stud.service.StageService  - checking job status
12:43:55,297 [pool-1-thread-2] INFO  com.stud.service.StageService  - calling getJobStatus
12:43:55,593 [pool-1-thread-2] INFO  com.stud.service.StageService  - checking job status completed. value equals 'R'
12:43:55,593 [pool-1-thread-2] INFO  com.stud.service.StageService  - Variable name: varLastActivity
12:43:55,593 [pool-1-thread-2] INFO  com.stud.service.listener.PrinterListener  - Activity name:wait10S    variables: [varLastActivity, varDSJobStatus]



<b>Exception:</b>

12:43:55,693 [pool-2-thread-2] ERROR org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable  - Job 127578 failed
org.activiti.engine.ActivitiException: couldn't instantiate class com.stud.service.listener.PrinterListener
        at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:137)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.defaultInstantiateDelegate(ClassDelegate.java:242)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:232)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getExecutionListenerInstance(ClassDelegate.java:103)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:95)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:42)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:636)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:629)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:636)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:629)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:636)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:629)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:636)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:629)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:636)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:629)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:636)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:629)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:636)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:629)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:453)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:431)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:140)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66)
        at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
        at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:47)
        at org.activiti.engine.impl.bpmn.behavior.IntermediateCatchEventActivityBehavior.signal(IntermediateCatchEventActivityBehavior.java:27)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:410)
        at org.activiti.engine.impl.jobexecutor.TimerCatchIntermediateEventJobHandler.execute(TimerCatchIntermediateEventJobHandler.java:58)
        at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:85)
        at org.activiti.engine.impl.persistence.entity.TimerEntity.execute(TimerEntity.java:95)
        at org.activiti.engine.impl.cmd.ExecuteAsyncJobCmd.execute(ExecuteAsyncJobCmd.java:52)
        at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
        at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:96)
        at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:50)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: org.activiti.engine.ActivitiClassLoadingException: Class not found: com.stud.service.listener.PrinterListener
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:87)
        at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:134)
        … 58 more
Caused by: java.lang.ClassNotFoundException: com.stud.service.listener.PrinterListener
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
        at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270)
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:291)
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:68)
        … 59 more

Outcomes