Reputation: 45
I'm trying to listen a task of camunda process, using spring boot. I write this class:
import org.camunda.bpm.engine.delegate.DelegateTask;
import org.camunda.bpm.engine.delegate.TaskListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Mytask implements TaskListener {
private Logger logger = LoggerFactory.getLogger(Mytask.class);
@Override
public void notify(DelegateTask delegateTask) {
logger.debug("This is Mytask listener");
}
}
I deploy a camunda process with a user task:
In this task, I defined a task listeners:
When I start a process instance, I've got this error:
I've got following error: Cannot submit task form 53768af3-9c8e-11ed-a686-540126414107: ENGINE-03051 There was an exception while invoking the TaskListener. Message: 'ENGINE-09008 Exception while instantiating class 'xxx.camunda.Mytask': ENGINE-09017 Cannot load class 'xxx.camunda.Mytask': xxx.camunda.Mytask'.
Upvotes: 0
Views: 2204
Reputation: 236
I faced same issue this morning. I dont know how, but my Configurations were changed in some way. I updated my Intellij Idea, maybe the upgration changed it. Anyway.. I fixed like that
Configurations > Modify Options > Shorten command line
Upvotes: 1
Reputation: 7628
The class you specified in the model cannot be found in the classloader.
Here is an example, also illustrating a few more things: https://github.com/rob2universe/flexible-delegate/blob/main/src/main/java/com/camunda/example/service/LoggerDelegate.java
https://github.com/rob2universe/flexible-delegate/blob/main/src/main/resources/process.bpmn
Upvotes: 0