Fabio Strada
Fabio Strada

Reputation: 45

Error start process instance of Camunda: ENGINE-09008 Exception while instantiating class

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:

enter image description here

In this task, I defined a task listeners:

enter image description here

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

Answers (2)

enesgonez
enesgonez

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

  • I enabled short command line from

Configurations > Modify Options > Shorten command line

  • When i enabled it, new input area was shown in popup. I selected classpath file enter image description here

Upvotes: 1

rob2universe
rob2universe

Reputation: 7628

The class you specified in the model cannot be found in the classloader.

  • make sure the fully qualified class name is spelled correctly in the model.
  • make sure the new model has been deployed successfully and you are starting a new process instances, based on this version (do not test with an old instance based on an old model)
  • make sure the class you are referencing compiles
  • make sure the class has been placed correctly in a src folder of your IDE and indeed ends up in the class path of the runtime
  • try a mvn clean package or equivalent via your IDE

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

Related Questions