Async process can't find execution listeners classes

Hi, I have a process with an execution listener that invokes a custom java class that invokes a web service. So far it was working fine, but I changed the process to start asynchronously and now, it cannot find the java class with the delegate code.

The class is in a jar …/webapps/camunda-engine/WEB-INF/lib/delegates.jar and it has been working fine in syncronous processes. But apparently, the job executor cannot find it. The configuration of the job-executor is the default one, I use a shared engine (version 7.5) and using REST to deploy and start process instances.

The exception got registered in /history/job-log:

{"id": "147d63d5-856d-11e6-a3f2-d8cb8ae5ad7b", "timestamp": "2016-09-28T13:17:02", "jobId": "147107be-856d-11e6-a3f2-d8cb8ae5ad7b", "jobDueDate": null, "jobRetries": 3, "jobPriority": 0, "jobExceptionMessage": "ENGINE-09008 Exception while instantiating class 'delegates.ProgressNotification': ENGINE-09017 Cannot load class 'delegates.ProgressNotification': delegates.ProgressNotification","jobDefinitionId": "324fc731-856c-11e6-a3f2-d8cb8ae5ad7b", "jobDefinitionType": "async-continuation", "jobDefinitionConfiguration": "async-before", "activityId": "StartEvent_10n649d", "executionId": "1470e0ab-856d-11e6-a3f2-d8cb8ae5ad7b", "processInstanceId": "1470e0ab-856d-11e6-a3f2-d8cb8ae5ad7b", "processDefinitionId": "Process_1046:1:324fc730-856c-11e6-a3f2-d8cb8ae5ad7b", "processDefinitionKey": "Process_1046", "deploymentId": "32462a3e-856c-11e6-a3f2-d8cb8ae5ad7b", "tenantId": "local", "creationLog": false, "failureLog": true, "successLog": false, "deletionLog": false}

The execution listener is placed in the end event of the task just after the start event.
Any ideas how to solve it? I red in the documentation about asynchronous and it mentioned that " execution listeners will not be invoked synchronously" but didn’t find anything else about it. Does it have anything to do with my problem?

Thanks for your time,
Gonzalo

1 Like

Hi @gcalvo,

which application server\web container are you using? Tomcat I assume.
one more question, is rest api deployed as separate webapp?

Cheers,
Askar

Yes, I’m using tomcat and the rest api is deployed in the same webapp. I’m using this distribution with postgresql database:

https://app.camunda.com/nexus/content/repositories/camunda-bpm/org/camunda/bpm/camunda-engine-rest/7.5.0/camunda-engine-rest-7.5.0-tomcat.war

Hi @gcalvo,

thanks for a quick reply. Could you please try to move delegates.jar into $CATALINA_BASE/lib. And see if it works then?

Cheers,
Askar

It worked perfectly, thank you a lot!
It was $CATALINA_HOME/lib though.

Thanks again!

Cheers,
Gonzalo

Hi @gcalvo,

happy that it solved your problem, but i think that might be an indicator of classloader issue on our side. Could you please give me a list of folders in your webapps folder? did you change anything in context.xml or server.xml files? if yes, could you attach them please?

Cheers,
Askar

In webapps I have the camunda app, the app my company develops and a folder named ROOT which is I think is part of the tomcat manager.
Regarding context.xml and server.xml, I’ve modified both files. Included the camunda configuration and jbpm config, which I tried some months ago, but the jbpm app is no longer installed. I don’t see anything weird in them.

server.xml (7.8 KB)
context.xml (1.6 KB)

thanks @gcalvo,

could you attach output of command tree webapps, attach your bpm-platform.xml and a log file with exception if you have it.

Cheers,
Askar

bpm-platform.xml (3.4 KB)

I extracted the error trace from β€˜catalina.out’, I copied a single one, but it repeated 3 times with each attempt to start the process (cause the job-executor retries).
trace.txt (31.7 KB)

I have to cut off the tree of webapp I’m developing because I don’t know what I’m allowed to show it and because it is huge. Really huge.

gcalvo@gcalvo-Aspire-XC-705:~$ tree /var/lib/tomcat7/webapps
/var/lib/tomcat7/webapps
β”œβ”€β”€ camunda-engine-rest
β”‚ β”œβ”€β”€ META-INF
β”‚ β”‚ β”œβ”€β”€ MANIFEST.MF
β”‚ β”‚ └── maven
β”‚ β”‚ └── org.camunda.bpm
β”‚ β”‚ └── camunda-engine-rest
β”‚ β”‚ β”œβ”€β”€ pom.properties
β”‚ β”‚ └── pom.xml
β”‚ └── WEB-INF
β”‚ β”œβ”€β”€ classes
β”‚ β”‚ β”œβ”€β”€ META-INF
β”‚ β”‚ β”‚ └── services
β”‚ β”‚ β”‚ └── org.camunda.bpm.engine.rest.spi.ProcessEngineProvider
β”‚ β”‚ └── org
β”‚ β”‚ └── camunda
β”‚ β”‚ └── bpm
β”‚ β”‚ └── engine
β”‚ β”‚ └── rest
β”‚ β”‚ └── impl
β”‚ β”‚ └── application
β”‚ β”‚ └── DefaultApplication.class
β”‚ β”œβ”€β”€ glassfish-web.xml
β”‚ β”œβ”€β”€ ibm-web-ext.xml
β”‚ β”œβ”€β”€ jboss-deployment-structure.xml
β”‚ β”œβ”€β”€ jboss-web.xml
β”‚ β”œβ”€β”€ lib
β”‚ β”‚ β”œβ”€β”€ activation-1.1.jar
β”‚ β”‚ β”œβ”€β”€ camunda-engine-rest-core-7.5.0.jar
β”‚ β”‚ β”œβ”€β”€ commons-fileupload-1.2.2.jar
β”‚ β”‚ β”œβ”€β”€ commons-io-2.0.1.jar
β”‚ β”‚ β”œβ”€β”€ delegates.jar
β”‚ β”‚ β”œβ”€β”€ jackson-annotations-2.6.0.jar
β”‚ β”‚ β”œβ”€β”€ jackson-core-2.6.3.jar
β”‚ β”‚ β”œβ”€β”€ jackson-databind-2.6.3.jar
β”‚ β”‚ β”œβ”€β”€ jackson-jaxrs-base-2.6.3.jar
β”‚ β”‚ β”œβ”€β”€ jackson-jaxrs-json-provider-2.6.3.jar
β”‚ β”‚ β”œβ”€β”€ jackson-module-jaxb-annotations-2.6.3.jar
β”‚ β”‚ β”œβ”€β”€ javassist-3.12.1.GA.jar
β”‚ β”‚ β”œβ”€β”€ jaxrs-api-2.3.5.Final.jar
β”‚ β”‚ β”œβ”€β”€ jcip-annotations-1.0.jar
β”‚ β”‚ β”œβ”€β”€ jsr250-api-1.0.jar
β”‚ β”‚ β”œβ”€β”€ resteasy-jaxrs-2.3.5.Final.jar
β”‚ β”‚ └── scannotation-1.0.3.jar
β”‚ β”œβ”€β”€ weblogic.xml
β”‚ └── web.xml
β”œβ”€β”€ camunda-engine-rest.war
β”œβ”€β”€ MyWebApp
…
β”œβ”€β”€ MyWebApp.war
└── ROOT
β”œβ”€β”€ index.html
└── META-INF
└── context.xml

@gcalvo,

I see, thanks for info. I think in your case lib folder of container is only solution which will work, I would suggest you remove delegates.jar from engine-rest/lib not to get confused.

Cheers,
Askar

I’ll do that. Thanks a lot for your help.

Cheers,
Gonzalo

I am experiencing same issue but with wildfly server. Please help

2020-04-06 15:11:28,290 ERROR [org.camunda.bpm.engine.context] (pool-11-thread-6) ENGINE-16004 Exception while closing command context: ENGINE-09008 Exception while instantiating class β€˜com.mycompany.project.server.workflow.EmptyClassCCS’: ENGINE-09017 Cannot load class β€˜com.mycompany.project.server.workflow.EmptyClassCCS’: com.mycompany.project.server.workflow.EmptyClassCCS from [Module β€œorg.camunda.bpm.camunda-engine:main” from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: C:\project12308_1_mysql\wildfly\modules,C:\project12308_1_mysql\wildfly\modules\system\layers\base))]: org.camunda.bpm.engine.ProcessEngineException: ENGINE-09008 Exception while instantiating class β€˜com.mycompany.project.server.workflow.EmptyClassCCS’: ENGINE-09017 Cannot load class β€˜com.mycompany.project.server.workflow.EmptyClassCCS’: com.mycompany.project.server.workflow.EmptyClassCCS from [Module β€œorg.camunda.bpm.camunda-engine:main” from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: C:\project12308_1_mysql\wildfly\modules,C:\project12308_1_mysql\wildfly\modules\system\layers\base))]
at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionWhileInstantiatingClass(EngineUtilLogger.java:81)
at org.camunda.bpm.engine.impl.util.ClassDelegateUtil.instantiateDelegate(ClassDelegateUtil.java:53)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior.getActivityBehaviorInstance(ClassDelegateActivityBehavior.java:111)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior$1.call(ClassDelegateActivityBehavior.java:67)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior$1.call(ClassDelegateActivityBehavior.java:64)
at org.camunda.bpm.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.executeWithErrorPropagation(AbstractBpmnActivityBehavior.java:110)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior.execute(ClassDelegateActivityBehavior.java:64)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:60)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:49)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.continueIfExecutionDoesNotAffectNextOperation(PvmExecutionImpl.java:1988)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:41)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:30)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:640)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:614)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl$6.callback(PvmExecutionImpl.java:1927)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl$6.callback(PvmExecutionImpl.java:1924)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.continueExecutionIfNotCanceled(PvmExecutionImpl.java:1994)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.dispatchDelayedEventsAndPerformOperation(PvmExecutionImpl.java:1943)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.dispatchDelayedEventsAndPerformOperation(PvmExecutionImpl.java:1924)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(PvmAtomicOperationTransitionNotifyListenerStart.java:60)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(PvmAtomicOperationTransitionNotifyListenerStart.java:30)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:67)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:72)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:649)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:624)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:60)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:72)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:649)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:624)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:60)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:72)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:649)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:624)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:60)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:640)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:614)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionCreateScope.scopeCreated(PvmAtomicOperationTransitionCreateScope.java:37)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:53)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:27)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:114)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:72)
at org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:80)
at org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:39)
at org.camunda.bpm.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:138)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:102)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:39)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:27)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:106)
at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:60)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:69)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:50)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:43)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:91)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:60)
at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:849)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)